Skip to content

Commit

Permalink
Merge pull request #10 from hellofresh/node-20-build
Browse files Browse the repository at this point in the history
Make action compatible with node 20
  • Loading branch information
gmsantos authored Apr 24, 2024
2 parents 445b177 + c637db2 commit dcf4e5d
Show file tree
Hide file tree
Showing 6 changed files with 30,157 additions and 8,137 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
name: Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
- run: npm ci
- run: npm run lint
- run: npm run package
Expand All @@ -34,9 +34,12 @@ jobs:
- run: echo Hello

check-run-defaults:
needs: [package, one, two]
name: Check run (defaults)
needs: [package, one, two]
runs-on: ubuntu-latest
permissions:
checks: write
actions: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
60 changes: 16 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,29 @@
# action-compile-job-status
GitHub Action compiling all job status of a workflow run

# Usage
You can use branch protection rules in GitHub pull requests to require specific status checks to pass before merging a pull request. In more complex workflows, especially if you have different workflow files to perform different jobs, you might want to require a specific status check that might not run for every PR, making it impossible to define a required status check.

Example workflow with dynamic jobs
```yaml
name: Clusters
With this action, you can consolidate workflow results in a single PR status check, making it possible to define a required check.

on:
pull_request:
branches:
- master
# Usage

```yaml
jobs:
changed-directories:
name: Generate job matrix
runs-on: [ self-hosted, default ]
outputs:
matrix-eks: ${{ steps.set-matrix-eks.outputs.matrix }}
eks-terraform:
name: EKS Terraform
needs: [ changed-directories ]
runs-on: [ self-hosted, default ]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.changed-directories.outputs.matrix-eks) }}
if: ${{ fromJson(needs.changed-directories.outputs.matrix-eks).include[0] }}
steps:
- name: Run terraform
uses: ./.github/actions/terraform
with:
dir: eks/${{ matrix.environment }}
command: plan

# Example use
# Job to compile status from all jobs and set context
compile:
name: compile-status
needs: [ namespace ]
runs-on: [ self-hosted, default ]
steps:

- uses: hellofresh/[email protected]
# Explicit permissions required for the action
# Can be omitted if default permission for GITHUB_TOKEN in the organization/repository level are set in permissive mode
#
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

permissions:
checks: write
actions: read

steps:
- uses: hellofresh/action-compile-job-status@v2
with:
check-run-name: ci-checks
check-run-title: Required check
ignore-jobs: ".*Best-practice|Report|compile*"
check-run-title: Title
```
## Reference
| | | | | |
|--- |--- |--- |--- |--- |
| | | | | |
| | | | | |
| | | | | |
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
description: Job patterns to ignore
required: false
runs:
using: node16
using: node20
main: dist/index.js
branding:
icon: check-circle
Expand Down
Loading

0 comments on commit dcf4e5d

Please sign in to comment.