Created
July 2, 2023 19:26
-
-
Save jonathanio/7eca51dcd5268c790daa2f8c843c49fd to your computer and use it in GitHub Desktop.
GitHub Workflows for `GITHUB_TOKEN` supported actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Terraform CI | |
on: | |
workflow_call: | |
# No inputs are required, as all information about the event will be pulled | |
# in from the context of the event itself | |
jobs: | |
terraform-checks: | |
name: Lint & Validate Terraform | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: And so on... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Label | |
on: | |
pull_request: | |
types: | |
- labeled | |
branches: | |
- main | |
jobs: | |
remove-force-ci-label: | |
name: Remove Label | |
runs-on: ubuntu-latest | |
if: ${{ github.event.label.name == 'force-ci-run' }} | |
steps: | |
- name: Remove the force-ci-run Label | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.removeLabel({ | |
issue_number: context.payload.pull_request.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
name: ['force-ci-run'] | |
}) | |
terraform-ci: | |
# This job name should match the name of call called Workflow in order | |
# for the name to successfully match any required status checks within | |
# the branch protections | |
name: Terraform CI | |
if: ${{ github.event.label.name == 'force-ci-run' }} | |
uses: ./.github/workflows/terraform-ci.yaml | |
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Pull Request | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
terraform-ci: | |
# This job name should match the name of call called Workflow in order | |
# for the name to successfully match any required status checks within | |
# the branch protections | |
name: Terraform CI | |
uses: ./.github/workflows/terraform-ci.yaml | |
secrets: inherit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment