-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add reusable github workflows (INT-1582) #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,39 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| GITHUB_TOKEN: | ||
| required: true | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: lint | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read # needed by trunk-action to read workflow run context | ||
| checks: write # needed by trunk-action to write check results | ||
| contents: read # needed by trunk-action to read repository contents | ||
| steps: | ||
| - name: Check out Git repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Trunk Check | ||
| uses: trunk-io/trunk-action@75699af9e26881e564e9d832ef7dc3af25ec031b # v1.2.4 | ||
| env: | ||
| # NOTE: inject the GITHUB_TOKEN for the trunk managed tflint linter | ||
| # https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| conventional-title: | ||
| name: conventional title | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: read # needed by action-semantic-pull-request to inspect pull request context | ||
| steps: | ||
| - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or 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,36 @@ | ||
| name: Release Please | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| release-type: | ||
| type: string | ||
| required: true | ||
| secrets: | ||
| MP_BOT_APP_ID: | ||
| required: true | ||
| MP_BOT_APP_PRIVATE_KEY: | ||
| required: true | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| release-please: | ||
| name: release please | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # needed by release-please-action to write repository contents | ||
| pull-requests: write # needed by release-please-action to write pull requests | ||
| issues: write # needed by release-please-action to write issues | ||
| steps: | ||
| - name: Create Token for MasterpointBot App | ||
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1 | ||
| id: generate-token | ||
| with: | ||
| app-id: ${{ secrets.MP_BOT_APP_ID }} | ||
| private-key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }} | ||
|
|
||
| - uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f #v4.1.3 | ||
| with: | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
| release-type: ${{ inputs.release-type }} |
This file contains hidden or 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,43 @@ | ||
| name: TF Test | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| aws_role_arn: | ||
| type: string | ||
| required: true | ||
| secrets: | ||
| SPACELIFT_API_KEY_ENDPOINT: | ||
| required: true | ||
| SPACELIFT_API_KEY_ID: | ||
| required: true | ||
| SPACELIFT_API_KEY_SECRET: | ||
| required: true | ||
| GITHUB_TOKEN: | ||
| required: true | ||
|
glaracuente marked this conversation as resolved.
|
||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| tf-test: | ||
| name: 🧪 ${{ matrix.tf }} test | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read # needed by github-action-tf-test to read workflow run context | ||
| checks: write # needed by github-action-tf-test to write check results | ||
| contents: read # needed by github-action-tf-test to read repository contents | ||
| id-token: write # needed by github-action-tf-test to write id token | ||
| pull-requests: read # needed by github-action-tf-test to read pull request context | ||
| env: | ||
| SPACELIFT_API_KEY_ENDPOINT: ${{ secrets.SPACELIFT_API_KEY_ENDPOINT }} | ||
| SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_API_KEY_ID }} | ||
| SPACELIFT_API_KEY_SECRET: ${{ secrets.SPACELIFT_API_KEY_SECRET }} | ||
| strategy: | ||
| matrix: | ||
| tf: [tofu, terraform] | ||
| steps: | ||
| - uses: masterpointio/github-action-tf-test@c1e41998f67925ac3f34e0bbcfcaa4a44d1f0cd9 # v1.0.1 | ||
| with: | ||
| tf_type: ${{ matrix.tf }} | ||
| aws_role_arn: ${{ inputs.aws_role_arn }} | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or 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,34 @@ | ||
| name: Trunk Upgrade | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| MP_BOT_APP_ID: | ||
| required: true | ||
| MP_BOT_APP_PRIVATE_KEY: | ||
| required: true | ||
| MASTERPOINT_TEAM_PAT: | ||
| required: true | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| trunk-upgrade: | ||
| name: trunk upgrade | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # needed by github-action-trunk-upgrade to write repository contents | ||
| pull-requests: write # needed by github-action-trunk-upgrade to write pull requests | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Run Trunk Upgrade | ||
| uses: masterpointio/github-action-trunk-upgrade@a79fd65d524d92031fe167daee411d2f25d4a999 # v0.1.0 | ||
| with: | ||
| app-id: ${{ secrets.MP_BOT_APP_ID }} | ||
| app-private-key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }} | ||
| github-token: ${{ secrets.MASTERPOINT_TEAM_PAT }} | ||
| reviewers: "@masterpointio/masterpoint-open-source" |
This file contains hidden or 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,25 @@ | ||
| name: Zizmor | ||
|
|
||
| on: | ||
| workflow_call: {} | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| zizmor: | ||
| name: zizmor | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Run zizmor | ||
| uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3 | ||
| with: | ||
| # Set to false, so zizmor will not upload results to Github Advanced Security | ||
| # and will instead print them to the Action's run log. | ||
| advanced-security: false | ||
| # Set to pedantic so that zizmor will run it's stale-action-refs audit rule | ||
| persona: pedantic |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.