-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from aquaproj/feat/add-reusable-workflow-2
feat: add a reusable workflow
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
name: test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
aqua_policy_config: | ||
required: false | ||
type: string | ||
aqua_version: | ||
required: true | ||
type: string | ||
secrets: | ||
gh_app_id: | ||
required: false | ||
gh_app_private_key: | ||
required: false | ||
|
||
env: | ||
AQUA_POLICY_CONFIG: ${{inputs.aqua_policy_config}} | ||
AQUA_LOG_COLOR: always | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
update-aqua-checksums: | ||
# Update aqua-checksums.json and push a commit | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read # To checkout private repository | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 | ||
- name: Generate token | ||
id: generate_token | ||
if: "! github.event.pull_request.head.repo.fork" | ||
uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c # v1 | ||
with: | ||
app_id: ${{secrets.gh_app_id}} | ||
private_key: ${{secrets.gh_app_private_key}} | ||
- uses: aquaproj/aqua-installer@61e2563dfe7674cbf74fe6ec212e444198a3bb00 # v2.0.2 | ||
# Install ghcp | ||
with: | ||
aqua_version: ${{inputs.aqua_version}} | ||
env: | ||
AQUA_GITHUB_TOKEN: ${{github.token}} | ||
- uses: aquaproj/update-checksum-action@4bb09f359f2ecdb20aa9bc61684f5f9d185be909 # v0.1.4 | ||
with: | ||
prune: true | ||
skip_push: ${{github.event.pull_request.head.repo.fork}} | ||
env: | ||
# To trigger GitHub Actions Workflow by pushing a commit, GitHub App token is required. | ||
# github.token doesn't trigger GitHub Actions Workflow. | ||
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow | ||
# > When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run. | ||
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} |
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