mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-02-02 23:39:03 +00:00
ci: Prevent duplicate CI runs on release
Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
This commit is contained in:
parent
0c3f44e3b7
commit
e5238adde0
21
.github/workflows/charts-release.yaml
vendored
21
.github/workflows/charts-release.yaml
vendored
@ -25,7 +25,6 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
ref: master
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Kubernetes tools
|
- name: Install Kubernetes tools
|
||||||
@ -64,19 +63,33 @@ jobs:
|
|||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
with:
|
with:
|
||||||
file_pattern: charts/**/
|
file_pattern: charts/**/
|
||||||
commit_message: "chore: Auto-update chart README"
|
commit_message: "chore: Auto-update chart README [skip ci]"
|
||||||
commit_user_name: k8s-at-home[bot]
|
commit_user_name: k8s-at-home[bot]
|
||||||
commit_user_email: k8s-at-home[bot]@users.noreply.github.com
|
commit_user_email: k8s-at-home[bot]@users.noreply.github.com
|
||||||
commit_author: k8s-at-home[bot] <k8s-at-home[bot]@users.noreply.github.com>
|
commit_author: k8s-at-home[bot] <k8s-at-home[bot]@users.noreply.github.com>
|
||||||
|
|
||||||
|
- name: Save commit hash
|
||||||
|
id: save-commit-hash
|
||||||
|
run: |
|
||||||
|
if [ "${{ steps.create-commit.outputs.changes_detected || 'unknown' }}" == "true" ]; then
|
||||||
|
echo '::set-output name=commit_hash::${{ steps.create-commit.outputs.commit_hash }}'
|
||||||
|
else
|
||||||
|
echo "::set-output name=commit_hash::${GITHUB_SHA}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
ref: ${{ steps.save-commit-hash.outputs.commit_hash }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Configure Git
|
- name: Configure Git
|
||||||
if: steps.create-commit.outputs.changes_detected == 'false'
|
|
||||||
run: |
|
run: |
|
||||||
git config user.name "k8s-at-home[bot]"
|
git config user.name "k8s-at-home[bot]"
|
||||||
git config user.email "k8s-at-home[bot]@users.noreply.github.com"
|
git config user.email "k8s-at-home[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Run chart-releaser
|
- name: Run chart-releaser
|
||||||
if: steps.create-commit.outputs.changes_detected == 'false'
|
|
||||||
uses: helm/chart-releaser-action@v1.2.1
|
uses: helm/chart-releaser-action@v1.2.1
|
||||||
with:
|
with:
|
||||||
charts_dir: charts/*
|
charts_dir: charts/*
|
||||||
|
@ -40,14 +40,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: ./pr_metadata/pr_number.txt
|
path: ./pr_metadata/pr_number.txt
|
||||||
|
|
||||||
- name: Remove workflow artifact
|
|
||||||
uses: riskledger/delete-artifacts@v1
|
|
||||||
with:
|
|
||||||
github_token: ${{ steps.generate-token.outputs.token }}
|
|
||||||
workflow: pr-validate.yaml
|
|
||||||
run_id: ${{ github.event.workflow_run.id }}
|
|
||||||
name: pr_metadata
|
|
||||||
|
|
||||||
- name: "Get workflow job status"
|
- name: "Get workflow job status"
|
||||||
uses: actions/github-script@v5
|
uses: actions/github-script@v5
|
||||||
id: get-workflow-jobs
|
id: get-workflow-jobs
|
||||||
|
1
.github/workflows/pr-metadata.yaml
vendored
1
.github/workflows/pr-metadata.yaml
vendored
@ -42,6 +42,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: pr_metadata
|
name: pr_metadata
|
||||||
path: ./pr_number.txt
|
path: ./pr_number.txt
|
||||||
|
retention-days: 5
|
||||||
|
|
||||||
pr-changes:
|
pr-changes:
|
||||||
name: Collect PR changes
|
name: Collect PR changes
|
||||||
|
Loading…
Reference in New Issue
Block a user