mirror of
https://github.com/truecharts/charts.git
synced 2026-07-07 19:45:16 -03:00
90 lines
3.1 KiB
YAML
90 lines
3.1 KiB
YAML
name: "Pull Request: Validate"
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.head_ref }}-pr-validate
|
|
# cancel-in-progress: true
|
|
|
|
jobs:
|
|
pr-changes:
|
|
name: Collect PR changes
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
addedOrModified: ${{ steps.collect-changes.outputs.changesDetected }}
|
|
addedOrModifiedFiles: ${{ steps.collect-changes.outputs.addedOrModifiedFiles }}
|
|
addedOrModifiedCharts: ${{ steps.collect-changes.outputs.addedOrModifiedCharts }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
|
|
|
|
- name: Collect changes
|
|
id: collect-changes
|
|
uses: ./.github/actions/collect-changes
|
|
|
|
charts-lint:
|
|
uses: ./.github/workflows/charts-lint.yaml
|
|
needs:
|
|
- pr-changes
|
|
with:
|
|
checkoutCommit: ${{ needs.charts-changelog.outputs.commitHash }}
|
|
chartChangesDetected: ${{ needs.pr-changes.outputs.addedOrModified }}
|
|
modifiedFiles: ${{ needs.pr-changes.outputs.addedOrModifiedFiles }}
|
|
modifiedCharts: ${{ needs.pr-changes.outputs.addedOrModifiedCharts }}
|
|
|
|
charts-test:
|
|
uses: ./.github/workflows/charts-test.yaml
|
|
needs:
|
|
- pr-changes
|
|
- charts-lint
|
|
if: ${{ !contains(github.event.pull_request.title, 'container image common') }} # Skip if PR title contains "container image common"
|
|
with:
|
|
checkoutCommit: ${{ needs.charts-changelog.outputs.commitHash }}
|
|
chartChangesDetected: ${{ needs.pr-changes.outputs.addedOrModified }}
|
|
modifiedCharts: ${{ needs.pr-changes.outputs.addedOrModifiedCharts }}
|
|
|
|
print_head_msg:
|
|
name: Print commit message
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
head-commit-message: ${{ steps.get_head_commit_message.outputs.headCommitMsg }}
|
|
pr-title: ${{ github.event.pull_request.title }}
|
|
steps:
|
|
- name: Get repo
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: verbose head git commit message
|
|
run: echo "$(git show -s --format=%s)"
|
|
- name: Print head git commit message
|
|
id: get_head_commit_message
|
|
run: echo "::set-output name=headCommitMsg::$(git show -s --format=%s)"
|
|
- name: Print PR title
|
|
run: |
|
|
echo "PR title: ${{ github.event.pull_request.title }}"
|
|
|
|
automerge-and-approve:
|
|
needs:
|
|
- pr-changes
|
|
- charts-lint
|
|
- print_head_msg
|
|
if: ${{
|
|
contains(needs.print_head_msg.outputs.head-commit-message, 'By Renovate') ||
|
|
contains(needs.print_head_msg.outputs.head-commit-message, '.all-contributorsrc') ||
|
|
contains(github.event.pull_request.title, 'image common') }}
|
|
name: Automerge and Approve build
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: hmarr/auto-approve-action@v3
|
|
with:
|
|
github-token: "${{ secrets.OR_PAT }}"
|
|
- name: automerge
|
|
uses: pascalgn/automerge-action@7961b8b5eec56cc088c140b56d864285eabd3f67 # v0.16.4
|
|
env:
|
|
GITHUB_TOKEN: "${{ secrets.BOT_TOKEN }}"
|
|
UPDATE_RETRIES: 12
|
|
UPDATE_RETRY_SLEEP: 60000
|
|
MERGE_METHOD: squash
|