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

Fix honoring skip phrases #217

Merged
merged 47 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a3c55ac
Update
walkowif Feb 27, 2024
7bd7718
Update
walkowif Feb 27, 2024
30705ba
Update
walkowif Feb 27, 2024
76945b2
Update
walkowif Feb 27, 2024
af28da4
Update
walkowif Feb 27, 2024
2586179
Update
walkowif Feb 27, 2024
dba05bb
Update
walkowif Feb 27, 2024
52cfe77
Update
walkowif Feb 27, 2024
6ff3db5
Update
walkowif Feb 28, 2024
ef7f841
Update
walkowif Feb 29, 2024
6bc2d85
Update
walkowif Feb 29, 2024
52d993e
Update
walkowif Feb 29, 2024
6501667
Try another method
walkowif Mar 1, 2024
6ea8e5a
Update
walkowif Mar 1, 2024
b17c404
Try cancelling with gh
walkowif Mar 1, 2024
c03dbaa
Update
walkowif Mar 1, 2024
6d86738
Update
walkowif Mar 1, 2024
4103f38
Update
walkowif Mar 4, 2024
120d8b4
Use action to install gh CLI
walkowif Mar 4, 2024
9f27958
Update
walkowif Mar 4, 2024
d8b905f
Cleanup
walkowif Mar 4, 2024
c9545c4
Cleanup
walkowif Mar 4, 2024
c4aaddd
Merge branch 'main' into debug-skip-phrases
cicdguy Mar 4, 2024
4a0014f
Update
walkowif Mar 7, 2024
a18b9e5
Merge branch 'debug-skip-phrases' of github.com:insightsengineering/r…
walkowif Mar 7, 2024
02e398f
Update
walkowif Mar 7, 2024
92c0a20
Update
walkowif Mar 7, 2024
dcf5419
Update workflows
walkowif Mar 7, 2024
ece8894
Update
walkowif Mar 7, 2024
e2357b3
Update
walkowif Mar 7, 2024
7090e03
Update
walkowif Mar 7, 2024
4ecbb51
Update
walkowif Mar 7, 2024
41a2f62
Update
walkowif Mar 7, 2024
0c8acc1
Show github context
walkowif Mar 7, 2024
7058cb4
Update
walkowif Mar 7, 2024
f49f72a
Update
walkowif Mar 7, 2024
51a1f3a
Get github context for push event
walkowif Mar 7, 2024
27b1d42
Update
walkowif Mar 7, 2024
31924f7
Cleanup
walkowif Mar 7, 2024
7d03539
Exit the job instead of cancelling the workflow
walkowif Mar 8, 2024
1897cb4
Try commit-message-checker
walkowif Mar 8, 2024
987a5ec
Cleanup
walkowif Mar 8, 2024
e94134d
Merge branch 'main' into debug-skip-phrases
walkowif Mar 8, 2024
f70c554
Restore job conditions
walkowif Mar 8, 2024
af4b52a
Cleanup
walkowif Mar 8, 2024
9ac1709
Test exit code = 0
walkowif Mar 8, 2024
4232ae1
Revert "Test exit code = 0"
walkowif Mar 8, 2024
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
29 changes: 29 additions & 0 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,37 @@ jobs:
!contains(github.event.commits[0].message, '[skip audit]')
&& github.event.pull_request.draft == false
steps:
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v7

- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 1

- name: Checkout repo 🛎
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
fetch-depth: 1

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
env:
SKIP_INSTRUCTION: "[skip audit]"

- name: Normalize inputs 🛠️
id: normalizer
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/bioccheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ jobs:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
path: ${{ github.event.repository.name }}

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
working-directory: ${{ github.event.repository.name }}
env:
SKIP_INSTRUCTION: "[skip bioccheck]"

- name: Restore SD cache 💰
uses: actions/cache@v4
with:
Expand Down
55 changes: 35 additions & 20 deletions .github/workflows/build-check-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,40 @@ jobs:
id: branch-name
uses: tj-actions/branch-names@v7

- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
path: ${{ github.event.repository.name }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
# When fetch-depth is set to 1 (default), and if additional commits are added
# to the branch between this step and the 'Set TESTING_DEPTH' step, git might fail
# referencing ${{ github.event.after }} commit
# because it's not the latest commit fetched by this step.
fetch-depth: 0

- name: Checkout repo 🛎
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
path: ${{ github.event.repository.name }}

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
working-directory: ${{ github.event.repository.name }}
env:
SKIP_INSTRUCTION: "[skip r-cmd]"

- name: Checkout gh-pages 🛎
if: >-
inputs.publish-unit-test-report-gh-pages == true
Expand Down Expand Up @@ -301,26 +335,6 @@ jobs:
run: npm i -g xunit-viewer
shell: bash

- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
path: ${{ github.event.repository.name }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
# When fetch-depth is set to 1 (default), and if additional commits are added
# to the branch between this step and the 'Set TESTING_DEPTH' step, git might fail
# referencing ${{ github.event.after }} commit
# because it's not the latest commit fetched by this step.
fetch-depth: 0

- name: Checkout repo 🛎
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
path: ${{ github.event.repository.name }}

- name: Restore SD cache 💰
if: inputs.install-deps-from-package-repositories == ''
uses: actions/cache@v4
Expand Down Expand Up @@ -843,6 +857,7 @@ jobs:
startsWith(github.ref, 'refs/tags/v')
&& (!contains(github.event.commits[0].message, '[skip r-cmd]'))
&& github.event.pull_request.draft == false

steps:
- name: Checkout repo 🛎
uses: actions/checkout@v4
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/gitleaks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,37 @@ jobs:
if: >
!contains(github.event.commits[0].message, '[skip gitleaks]')
&& github.event.pull_request.draft == false

steps:
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v7

- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Checkout repo 🛎
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
env:
SKIP_INSTRUCTION: "[skip gitleaks]"

- name: Download and install gitleaks 💧
run: |
Expand Down Expand Up @@ -68,12 +96,40 @@ jobs:
!contains(github.event.commits[0].message, '[skip pii-check]')
&& github.event.pull_request.draft == false
&& inputs.check-for-pii == true

steps:
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v7

- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0

- name: Checkout repo 🛎
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
fetch-depth: 0

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
env:
SKIP_INSTRUCTION: "[skip pii-check]"

- name: Run Presidio to check for PII ☔
uses: insightsengineering/presidio-action@v1
with:
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/grammar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,35 @@ jobs:
&& github.event.pull_request.draft == false

steps:
- name: Checkout Code 🛎
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v7

- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Checkout repo 🛎
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
env:
SKIP_INSTRUCTION: "[skip grammar]"

- name: Restore npm cache 💰
uses: actions/cache@v4
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,37 @@ jobs:
if: >
!contains(github.event.commits[0].message, '[skip licenses]')
&& github.event.pull_request.draft == false

steps:
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v7

- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Checkout repo 🛎
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
env:
SKIP_INSTRUCTION: "[skip licenses]"

- name: Generate license report 📜
uses: insightsengineering/r-license-report@v1
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,35 @@ jobs:
!contains(github.event.commits[0].message, '[skip links]')
&& github.event.pull_request.draft == false
steps:
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v7

- name: Checkout repo (PR) 🛎
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Checkout repo 🛎
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
env:
SKIP_INSTRUCTION: "[skip links]"

- name: Check URLs in docs 🔬
uses: lycheeverse/[email protected]
Expand Down
Loading
Loading