Skip to content
Open

Master #20691

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e02a2ce
Add SLSA generic generator workflow
JohnDaWalka Oct 28, 2025
d0951db
Add GitHub Actions workflow for Go project
JohnDaWalka Oct 28, 2025
3bede9a
Add SLSA Go releaser workflow
JohnDaWalka Oct 28, 2025
5f99acb
Add workflow for publishing Node.js package
JohnDaWalka Oct 28, 2025
d51ab08
Merge pull request #1 from smartcontractkit/develop
JohnDaWalka Nov 17, 2025
757ad37
Update .github/workflows/npm-publish-github-packages.yml
JohnDaWalka Nov 18, 2025
d495fa4
Merge branch 'smartcontractkit:develop' into develop
JohnDaWalka Nov 19, 2025
c3b3753
Initial plan
Copilot Nov 19, 2025
c3aa2cc
Update sync-develop workflow to use PAT_TOKEN and add setup documenta…
Copilot Nov 19, 2025
d082bec
Update SYNC_DEVELOP_SETUP.md
JohnDaWalka Nov 21, 2025
7ccc4bb
Merge pull request #3 from JohnDaWalka/copilot/fix-sync-develop-workflow
JohnDaWalka Nov 23, 2025
d17d007
Initial plan
Copilot Nov 25, 2025
2c4147b
Fix sync workflow by using GITHUB_TOKEN instead of PAT_TOKEN
Copilot Nov 25, 2025
775169e
Merge pull request #4 from JohnDaWalka/copilot/add-token-input-to-wor…
JohnDaWalka Nov 25, 2025
9d98c0d
Merge branch 'smartcontractkit:develop' into develop
JohnDaWalka Nov 25, 2025
4363170
Initial plan
Copilot Nov 25, 2025
ddcf377
Replace pnpm/action-setup with corepack in delete-deployments action
Copilot Nov 25, 2025
be7952a
Merge pull request #5 from JohnDaWalka/copilot/remove-pnpm-action-setup
JohnDaWalka Nov 25, 2025
1d3fd21
Update action.yml for delete deployments action
JohnDaWalka Nov 25, 2025
fafc1fd
Update .github/workflows/delete-deployments.yml
JohnDaWalka Nov 25, 2025
3120136
Update action.yml for delete deployments action
JohnDaWalka Nov 25, 2025
b6f3f7a
Update actions/setup-node to v4 instead of invalid commit SHA
Copilot Dec 5, 2025
5ae0b1a
Remove misleading comment about commit pinning
Copilot Dec 5, 2025
3fea153
Add branch validation to sync workflow to prevent checkout failures (…
Copilot Dec 5, 2025
278b096
Update sync workflow
JohnDaWalka Dec 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 46 additions & 12 deletions .github/actions/delete-deployments/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ description: Delete deployments by env and ref
inputs:
environment:
required: true
description: The Github environment to filter deployments by
description: The GitHub environment to filter deployments by
ref:
required: true
description: The ref to filter deployments by
dry-run:
required: false
description: Whether to actually delete deployments or not
github-token:
description: "The Github token to use for authentication"
description: "The GitHub token to use for authentication"
required: true
default: ${{ github.token }}
num-of-pages:
required: false
description: The number of pages (of 100 per page) to fetch deployments from, set to 'all' to fetch all deployments
description: The number of pages (100 per page) to fetch deployments from, set to 'all' to fetch all deployments
default: "all"
starting-page:
required: false
Expand All @@ -25,35 +25,69 @@ inputs:
required: false
description: The owner and repository name to delete deployments from, defaults to the current repository, ex. 'smartcontractkit/chainlink'
default: ${{ github.repository }}
owner:
required: false
description: Repository owner (derived automatically)
default: ${{ github.repository_owner }}
Comment on lines +28 to +31
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'owner' input is defined but never used in the script. The OWNER environment variable is set from inputs.owner but it's redundant since github.repository_owner is already available. Consider removing this input if it's not needed, or document its purpose if it serves a specific use case.

Copilot uses AI. Check for mistakes.

runs:
using: composite
steps:
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ^10.0.0

- uses: actions/setup-node@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: "./.github/actions/delete-deployments/pnpm-lock.yaml"
cache-dependency-path: ".github/actions/delete-deployments/pnpm-lock.yaml"

- name: Enable pnpm via Corepack
shell: bash
run: |
corepack enable
corepack prepare pnpm@10 --activate
pnpm --version

- name: Validate inputs
shell: bash
run: |
error() { echo "::error::$1"; exit 1; }
[ -z "${{ inputs.environment }}" ] && error "environment input is required"
[ -z "${{ inputs.ref }}" ] && error "ref input is required"
if [ "${{ inputs.num-of-pages }}" != "all" ]; then
echo "${{ inputs.num-of-pages }}" | grep -Eq '^[0-9]+$' || error "num-of-pages must be a number or 'all'"
if [ -n "${{ inputs.starting-page }}" ]; then
echo "${{ inputs.starting-page }}" | grep -Eq '^[0-9]+$' || error "starting-page must be numeric"
if [ ${{ inputs.starting-page }} -gt ${{ inputs.num-of-pages }} ]; then
error "starting-page cannot exceed num-of-pages"
fi
fi
fi
# Normalize environment name and export for later steps
ENV_LC=$(echo "${{ inputs.environment }}" | tr '[:upper:]' '[:lower:]')
echo "ENVIRONMENT_NORMALIZED=$ENV_LC" >> "$GITHUB_ENV"
echo "Validated inputs for environment=$ENV_LC ref='${{ inputs.ref }}'"

- name: Install dependencies
shell: bash
run: pnpm i --prod
working-directory: "./.github/actions/delete-deployments"
run: |
if [ -f pnpm-lock.yaml ]; then
pnpm install --frozen-lockfile --prod
else
pnpm install --prod
fi

- name: Run deployment deleter
shell: bash
run: pnpm start
working-directory: "./.github/actions/delete-deployments"
env:
NUM_OF_PAGES: ${{ inputs.num-of-pages }}
STARTING_PAGE: ${{ inputs.starting-page }}
GITHUB_TOKEN: ${{ inputs.github-token }}
ENVIRONMENT: ${{ inputs.environment }}
ENVIRONMENT_NORMALIZED: ${{ env.ENVIRONMENT_NORMALIZED }}
REF: ${{ inputs.ref }}
DRY_RUN: ${{ inputs.dry-run }}
OWNER: ${{ inputs.owner }}
REPOSITORY: ${{ inputs.repository }}
working-directory: "./.github/actions/delete-deployments"
run: pnpm start
Comment on lines 80 to +93
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The working-directory is specified after the run command. According to GitHub Actions syntax, working-directory should be at the same level as 'run' and 'shell', not after it. This ordering could cause confusion or potentially fail depending on the YAML parser.

Copilot uses AI. Check for mistakes.
65 changes: 65 additions & 0 deletions .github/workflows/SYNC_DEVELOP_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Sync Develop Workflow Setup

This document provides instructions for setting up the "Sync develop from smartcontractkit/chainlink" workflow.

## Overview

The `sync-develop-from-smartcontractkit-chainlink.yml` workflow automatically syncs the `develop` branch from the upstream repository (`smartcontractkit/chainlink`) to your fork every 30 minutes.
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states that the workflow runs "every 30 minutes", but the actual cron schedule in the workflow file is "0 * * * *" which runs hourly. Update the documentation to reflect the correct hourly schedule.

Copilot uses AI. Check for mistakes.

## Required Setup

To enable this workflow, you need to create a Personal Access Token (PAT) and add it as a repository secret.

### Step 1: Create a Personal Access Token

1. Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Direct link: https://github.com/settings/tokens
2. Click "Generate new token" → "Generate new token (classic)"
3. Configure the token:
- **Note**: `Chainlink Fork Sync Token`
- **Expiration**: Choose an appropriate expiration (recommended: 90 days or No expiration for continuous sync)
- **Scopes**: Select the following permissions:
-`repo` (Full control of private repositories) - Required to push to your repository
4. Click "Generate token"
5. **Important**: Copy the token immediately - you won't be able to see it again!

### Step 2: Add the Token as a Repository Secret

1. Go to your forked repository on GitHub
2. Navigate to Settings → Secrets and variables → Actions
3. Click "New repository secret"
4. Configure the secret:
- **Name**: `PAT_TOKEN` (must be exactly this name)
- **Value**: Paste the Personal Access Token you created in Step 1
5. Click "Add secret"

### Step 3: Verify the Setup

After adding the secret, the workflow will automatically use it on the next scheduled run (every 30 minutes).
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states that the workflow runs "every 30 minutes" again in Step 3, but the actual schedule is hourly. Update this reference to match the actual cron schedule.

Copilot uses AI. Check for mistakes.

To manually trigger a test:
1. Go to Actions tab in your repository
2. Select "Sync develop from smartcontractkit/chainlink" workflow
3. If the workflow file includes a `workflow_dispatch` trigger, you can click "Run workflow" to trigger it manually. (By default, this workflow only runs on a schedule.)

Alternatively, wait for the next scheduled run and check the workflow logs to ensure it completes successfully.

## Troubleshooting

### Authentication Failed Error
- Verify the `PAT_TOKEN` secret exists and is spelled correctly
- Ensure the token has the `repo` scope enabled
- Check if the token has expired and create a new one if needed

### Push Permission Denied
- The PAT must have write access to your fork
- Verify you're using a token associated with an account that has push permissions to the repository

### Workflow Not Running
- This workflow only runs on forks (not on `smartcontractkit/chainlink`)
- Check the Actions tab to see if the workflow is enabled
- Verify the workflow file is present in the `.github/workflows` directory

## Security Note

Never commit your Personal Access Token directly in code or configuration files. Always use GitHub Secrets to store sensitive credentials.
16 changes: 11 additions & 5 deletions .github/workflows/delete-deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@ name: Cleanup integration deployments
on:
workflow_dispatch:
schedule:
# every 10 mins
- cron: "*/10 * * * *"
# hourly cleanup to reduce API usage vs every 10 mins
- cron: "0 * * * *"

jobs:
cleanup:
name: Clean up integration environment deployments
runs-on: ubuntu-latest
permissions:
deployments: write
contents: read
concurrency:
group: cleanup-deployments
cancel-in-progress: false
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Clean up integration environment
- name: Clean up integration environment deployments
uses: ./.github/actions/delete-deployments
with:
environment: integration
# Delete 300 deployments at a time
ref: ${{ github.ref_name }}
num-of-pages: 3
# We start with page 2 because usually the first 200 deployments are still active, so we cannot delete them
starting-page: 2
dry-run: false
66 changes: 66 additions & 0 deletions .github/workflows/generator-generic-ossf-slsa3-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow lets you generate SLSA provenance file for your project.
# The generation satisfies level 3 for the provenance requirements - see https://slsa.dev/spec/v0.1/requirements
# The project is an initiative of the OpenSSF (openssf.org) and is developed at
# https://github.com/slsa-framework/slsa-github-generator.
# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier.
# For more information about SLSA and how it improves the supply-chain, visit slsa.dev.

name: SLSA generic generator
on:
workflow_dispatch:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
outputs:
digests: ${{ steps.hash.outputs.digests }}

steps:
- uses: actions/checkout@v4

# ========================================================
#
# Step 1: Build your artifacts.
#
# ========================================================
- name: Build artifacts
run: |
# These are some amazing artifacts.
echo "artifact1" > artifact1
echo "artifact2" > artifact2
# ========================================================
#
# Step 2: Add a step to generate the provenance subjects
# as shown below. Update the sha256 sum arguments
# to include all binaries that you generate
# provenance for.
#
# ========================================================
- name: Generate subject for provenance
id: hash
run: |
set -euo pipefail
# List the artifacts the provenance will refer to.
files=$(ls artifact*)
# Generate the subjects (base64 encoded).
echo "hashes=$(sha256sum $files | base64 -w0)" >> "${GITHUB_OUTPUT}"
provenance:
needs: [build]
permissions:
actions: read # To read the workflow path.
id-token: write # To sign the provenance.
contents: write # To add assets to a release.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.4.0
with:
base64-subjects: "${{ needs.build.outputs.digests }}"
upload-assets: true # Optional: Upload to a new release
38 changes: 38 additions & 0 deletions .github/workflows/go-ossf-slsa3-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow lets you compile your Go project using a SLSA3 compliant builder.
# This workflow will generate a so-called "provenance" file describing the steps
# that were performed to generate the final binary.
# The project is an initiative of the OpenSSF (openssf.org) and is developed at
# https://github.com/slsa-framework/slsa-github-generator.
# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier.
# For more information about SLSA and how it improves the supply-chain, visit slsa.dev.

name: SLSA Go releaser
on:
workflow_dispatch:
release:
types: [created]

permissions: read-all

jobs:
# ========================================================================================================================================
# Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project.
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment - "Prerequesite" should be "Prerequisite".

Suggested change
# Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project.
# Prerequisite: Create a .slsa-goreleaser.yml in the root directory of your project.

Copilot uses AI. Check for mistakes.
# See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file
#=========================================================================================================================================
build:
permissions:
id-token: write # To sign.
contents: write # To upload release assets.
actions: read # To read workflow path.
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.4.0
with:
go-version: 1.17
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go version 1.17 is significantly outdated and has been out of support since August 2022. This could introduce security vulnerabilities and prevent the use of modern Go features. Consider updating to a more recent Go version (1.21 or later) that is actively maintained.

Suggested change
go-version: 1.17
go-version: '1.21'

Copilot uses AI. Check for mistakes.
# =============================================================================================================
# Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects
# =============================================================================================================

28 changes: 28 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go version 1.20 may be outdated depending on the project requirements. Go 1.20 reached end of life in February 2024. Consider using a more recent version like 1.21 or later, or make this configurable if the project has specific version requirements.

Suggested change
go-version: '1.20'
go-version: '1.21.x'

Copilot uses AI. Check for mistakes.

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
35 changes: 35 additions & 0 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci

publish-gpr:
needs: build
Comment on lines +11 to +21
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build job runs 'npm ci' but doesn't preserve the installed node_modules for the publish-gpr job that follows. This means publish-gpr will have to reinstall all dependencies again, making the separate build job unnecessary. Either remove the build job entirely and just have the publish-gpr job, or use actions/cache or artifacts to share the node_modules between jobs.

Suggested change
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
publish-gpr:
needs: build
publish-gpr:

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Loading