Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make action compatible with node 20 #10

Merged
merged 6 commits into from
Apr 24, 2024
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
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
Loading