Skip to content

Commit d8b2005

Browse files
committed
Implement setup-node action with safe-chain
1 parent f1ce10e commit d8b2005

10 files changed

Lines changed: 565 additions & 389 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# CHANGE_ME - set correct code owner
2-
* @linz/step-enablement
1+
* @linz/step-security

.github/dependabot.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
6-
version: 2
7-
8-
updates:
9-
- package-ecosystem: "github-actions"
10-
directory: "/"
11-
schedule:
12-
interval: weekly
13-
commit-message:
14-
prefix: "fix(deps)"
15-
cooldown:
16-
default-days: 15
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
8+
updates:
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: weekly
13+
commit-message:
14+
prefix: "fix(deps)"
15+
cooldown:
16+
default-days: 15

.github/workflows/ci.yml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
1-
name: CI
2-
on:
3-
pull_request:
4-
branches: [master]
5-
6-
jobs:
7-
test:
8-
runs-on: ubuntu-latest
9-
permissions:
10-
contents: write
11-
steps:
12-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
13-
14-
# CHANGE_ME - implement automation test for the actual action
15-
- name: invoke action
16-
uses: ./
17-
with:
18-
input1: foo
19-
input2: bar
20-
21-
- name: Verify the result
22-
run: |
23-
source assert.sh
24-
assert_eq "foo" "$DUMMY_INPUT1"
25-
assert_eq "bar" "$DUMMY_INPUT2"
1+
name: CI
2+
on:
3+
pull_request:
4+
branches: [master]
5+
6+
jobs:
7+
build:
8+
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [18.x, 20.x, 22.x]
14+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: ./
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
cache: 'npm'
23+
- run: npm ci
24+
- run: npm run build --if-present
25+
- name: Test Safe Chains
26+
run: |
27+
set +e
28+
npm install safe-chain-test
29+
exitCode=$?
30+
if [[ $exitCode -eq 1 ]]; then
31+
echo "Failed to download malware test!"
32+
else
33+
exit 1
34+
fi
35+
exit 0
36+
continue-on-error: true
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
name: Dependabot automation
2-
3-
on: pull_request
4-
5-
permissions:
6-
contents: write
7-
pull-requests: write
8-
9-
jobs:
10-
dependabot:
11-
runs-on: ubuntu-latest
12-
if: github.actor == 'dependabot[bot]'
13-
steps:
14-
- name: Dependabot metadata
15-
id: metadata
16-
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
17-
with:
18-
github-token: "${{ secrets.GITHUB_TOKEN }}"
19-
- name: Approve PR
20-
run: gh pr review --approve "$PR_URL"
21-
env:
22-
PR_URL: ${{ github.event.pull_request.html_url }}
23-
GITHUB_TOKEN: ${{ secrets.STEP_GITHUB_ACTION_TOKEN }}
24-
- name: Enable auto-merge for Dependabot PRs that doesn't include major version update
25-
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
26-
run: gh pr merge --auto --squash "$PR_URL"
27-
env:
28-
PR_URL: ${{ github.event.pull_request.html_url }}
29-
GITHUB_TOKEN: ${{ secrets.STEP_GITHUB_ACTION_TOKEN }}
30-
1+
name: Dependabot automation
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
dependabot:
11+
runs-on: ubuntu-latest
12+
if: github.actor == 'dependabot[bot]'
13+
steps:
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
- name: Approve PR
20+
run: gh pr review --approve "$PR_URL"
21+
env:
22+
PR_URL: ${{ github.event.pull_request.html_url }}
23+
GITHUB_TOKEN: ${{ secrets.STEP_GITHUB_ACTION_TOKEN }}
24+
- name: Enable auto-merge for Dependabot PRs that doesn't include major version update
25+
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
26+
run: gh pr merge --auto --squash "$PR_URL"
27+
env:
28+
PR_URL: ${{ github.event.pull_request.html_url }}
29+
GITHUB_TOKEN: ${{ secrets.STEP_GITHUB_ACTION_TOKEN }}
30+

.github/workflows/lint-pr.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: "Lint PR"
2-
3-
on:
4-
pull_request:
5-
types: ["opened", "edited", "reopened", "synchronize"]
6-
7-
jobs:
8-
pr-lint:
9-
runs-on: ubuntu-latest
10-
steps:
1+
name: "Lint PR"
2+
3+
on:
4+
pull_request:
5+
types: ["opened", "edited", "reopened", "synchronize"]
6+
7+
jobs:
8+
pr-lint:
9+
runs-on: ubuntu-latest
10+
steps:
1111
- uses: linz/action-pull-request-lint@7adb4bc59b59dc6e097de831c29a17c2c1338826 # v1.2.0

.github/workflows/release.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: release-please
2-
3-
on:
4-
push:
5-
branches:
6-
- master
7-
8-
permissions:
9-
contents: write
10-
pull-requests: write
11-
12-
jobs:
13-
release-please:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
17-
with:
18-
release-type: simple
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
17+
with:
18+
release-type: simple
1919
token: ${{ secrets.STEP_GITHUB_ACTION_TOKEN }}

0 commit comments

Comments
 (0)