Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
56 changes: 52 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,69 @@
name: PR automations
on:
pull_request:
branches:
- main
jobs:
lint-code:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ec2-github-runner-${{ hashFiles('**/package-lock.json') }}
- name: Install packages
run: npm install
- name: Run linter
run: npm run lint

verify-dist:
name: Verify dist is up to date
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install packages
run: npm ci
- name: Rebuild dist
# @vercel/ncc 0.25.1 uses a webpack version that needs the
# legacy OpenSSL provider on modern Node for module hashing.
run: NODE_OPTIONS=--openssl-legacy-provider npm run package
- name: Fail if dist/ differs from committed copy
run: |
if ! git diff --quiet -- dist/; then
echo "::error::dist/index.js is out of sync with src/."
echo "::error::Run 'NODE_OPTIONS=--openssl-legacy-provider npm run package' locally and commit the rebuilt dist/."
git diff --stat -- dist/
exit 1
fi

verify-runner-url:
name: Verify pinned actions/runner release exists
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract runner version from src/aws.js
id: extract
run: |
version=$(grep -oE 'actions/runner/releases/download/v[0-9]+\.[0-9]+\.[0-9]+' src/aws.js | head -1 | sed 's|.*/v||')
if [ -z "$version" ]; then
echo "::error::Could not locate the pinned actions/runner version in src/aws.js"
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Pinned actions/runner: v$version"
- name: HEAD check the Linux x64 release asset
env:
VERSION: ${{ steps.extract.outputs.version }}
run: |
url="https://github.com/actions/runner/releases/download/v${VERSION}/actions-runner-linux-x64-${VERSION}.tar.gz"
echo "Checking $url"
curl -fsSLI -o /dev/null "$url"
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55162,8 +55162,8 @@ async function startEc2Instance(label, githubRegistrationToken) {
'yum install -y libicu make',
'mkdir actions-runner && cd actions-runner',
'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}',
'curl -O -L https://github.com/actions/runner/releases/download/v2.321.0/actions-runner-linux-${RUNNER_ARCH}-2.321.0.tar.gz',
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.321.0.tar.gz',
'curl -O -L https://github.com/actions/runner/releases/download/v2.333.1/actions-runner-linux-${RUNNER_ARCH}-2.333.1.tar.gz',
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.333.1.tar.gz',
'export RUNNER_ALLOW_RUNASROOT=1',
'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1',
`./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`,
Expand Down
4 changes: 2 additions & 2 deletions src/aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ async function startEc2Instance(label, githubRegistrationToken) {
'yum install -y libicu make',
'mkdir actions-runner && cd actions-runner',
'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}',
'curl -O -L https://github.com/actions/runner/releases/download/v2.321.0/actions-runner-linux-${RUNNER_ARCH}-2.321.0.tar.gz',
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.321.0.tar.gz',
'curl -O -L https://github.com/actions/runner/releases/download/v2.333.1/actions-runner-linux-${RUNNER_ARCH}-2.333.1.tar.gz',
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.333.1.tar.gz',
'export RUNNER_ALLOW_RUNASROOT=1',
'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1',
`./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`,
Expand Down
Loading