forked from chanzuckerberg/fogg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: go mod changed format Ref: - golang/go#62278 (comment) may require re-installing go language server after upgrading to 1.21 ```sh go install golang.org/x/tools/gopls@latest ``` or: 1. Press Ctrl Shift P 1. Select Go: Install/Update tools * chore: bump gh action versions | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `2.4.0` | `4.0.0` | | [actions/cache](https://github.com/actions/cache) | `2` | `3` | | [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `1.6.1` | `4.0.0` | | [actions/setup-python](https://github.com/actions/setup-python) | `3` | `4` | | [mfinelli/setup-shfmt](https://github.com/mfinelli/setup-shfmt) | `1` | `2` | | [dorny/paths-filter](https://github.com/dorny/paths-filter) | `2.10.2` | `2.11.1` | | [terraform-linters/setup-tflint](https://github.com/terraform-linters/setup-tflint) | `2` | `3` | * chore: run make update-golden-files * chore: Add PR conventional commit title check
- Loading branch information
1 parent
aef3cab
commit 466bdda
Showing
6 changed files
with
64 additions
and
36 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,28 @@ | ||
# Validates PR title follows conventional commits | ||
on: | ||
pull_request: | ||
types: | ||
- edited | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
conventional_commit_title: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
# source https://github.com/chanzuckerberg/github-actions/blob/cac0ba177b109becac01bc340a3a1547feb40fe5/.github/actions/conventional-commits/action.yml | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const validator = /^(chore|feat|fix|revert|docs|style)(\((((CCIE|CDI|PRODSEC|SECENG|ONCALL)-[0-9]+)|([a-z]+))\))?(!)?: (.)+$/ | ||
const title = context.payload.pull_request.title | ||
const is_valid = validator.test(title) | ||
if (!is_valid) { | ||
const details = JSON.stringify({ | ||
title: title, | ||
valid_syntax: validator.toString(), | ||
}) | ||
core.setFailed(`Your pr title doesn't adhere to conventional commits syntax. See more details: ${details}`) | ||
} |
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
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
# required to push fixes back to repo | ||
contents: write{{ end }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4.0.0 | ||
with: | ||
repository: {{`${{ github.event.pull_request.head.repo.full_name }}`}} | ||
ref: {{`${{ github.event.pull_request.head.ref }}`}} | ||
|
@@ -30,15 +30,15 @@ jobs: | |
- run: make setup | ||
{{- if not (eq (len $githubActionsCI.DefaultAWSIAMRoleName) 0) }} | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
uses: aws-actions/configure-aws-credentials@v4.0.0 | ||
with: | ||
role-to-assume: {{ $githubActionsCI.DefaultAWSIAMRoleName }} | ||
aws-region: {{ $githubActionsCI.DefaultAWSRegion }}{{ end }} | ||
- run: .fogg/bin/fogg apply | ||
env: | ||
FOGG_GITHUBTOKEN: {{`${{ secrets.GITHUB_TOKEN }}`}} | ||
- uses: actions/setup-python@v3 | ||
- uses: mfinelli/setup-shfmt@v1 | ||
- uses: actions/setup-python@v4 | ||
- uses: mfinelli/setup-shfmt@v2 | ||
with: | ||
shfmt-version: 3.5.1 | ||
- uses: rhythmictech/[email protected] | ||
|
@@ -56,11 +56,11 @@ jobs: | |
outputs: | ||
allChanges: {{`${{ steps.changedDirs.outputs.allChanges }}`}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4.0.0 | ||
with: | ||
repository: {{`${{ github.event.pull_request.head.repo.full_name }}`}} | ||
ref: {{`${{ github.event.pull_request.head.ref }}`}} | ||
- uses: dorny/paths-filter@v2.10.2 | ||
- uses: dorny/paths-filter@v2.11.1 | ||
id: filter | ||
with: | ||
initial-fetch-depth: '1' | ||
|
@@ -92,7 +92,7 @@ jobs: | |
tfmodule: {{`${{ fromJson(needs.find-changed-dirs.outputs.allChanges) }}`}} | ||
if: {{`${{ needs.find-changed-dirs.outputs.allChanges != '[]' }}`}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4.0.0 | ||
with: | ||
token: {{`${{ secrets.GITHUB_TOKEN }}`}} | ||
repository: {{`${{ github.event.pull_request.head.repo.full_name }}`}} | ||
|
@@ -118,12 +118,12 @@ jobs: | |
add: -A | ||
message: | | ||
commit from fogg_ci -- ran terraform fmt and pushed | ||
- uses: actions/cache@v2 | ||
- uses: actions/cache@v3 | ||
name: Cache plugin dir | ||
with: | ||
path: ~/.tflint.d/plugins | ||
key: tflint-{{`${{ hashFiles('.tflint.hcl') }}`}} | ||
- uses: terraform-linters/setup-tflint@v2 | ||
- uses: terraform-linters/setup-tflint@v3 | ||
name: Setup TFLint | ||
with: | ||
tflint_version: v0.47.0 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 9 additions & 9 deletions
18
testdata/github_actions_with_iam_role/.github/workflows/fogg_ci.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.