2022-03-30 08:46:56 +00:00
|
|
|
name: "Pull Request: Get metadata"
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
outputs:
|
|
|
|
isRenovatePR:
|
|
|
|
description: "Is the PR coming from Renovate?"
|
|
|
|
value: ${{ jobs.pr-metadata.outputs.isRenovatePR }}
|
|
|
|
isFork:
|
|
|
|
description: "Is the PR coming from a forked repo?"
|
|
|
|
value: ${{ jobs.pr-metadata.outputs.isFork }}
|
|
|
|
addedOrModified:
|
|
|
|
description: "Does the PR contain any changes?"
|
|
|
|
value: ${{ jobs.pr-changes.outputs.addedOrModified }}
|
|
|
|
addedOrModifiedFiles:
|
|
|
|
description: "A list of the files changed in this PR"
|
|
|
|
value: ${{ jobs.pr-changes.outputs.addedOrModifiedFiles }}
|
|
|
|
addedOrModifiedCharts:
|
|
|
|
description: "A list of the charts changed in this PR"
|
|
|
|
value: ${{ jobs.pr-changes.outputs.addedOrModifiedCharts }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
pr-metadata:
|
|
|
|
name: Collect PR metadata
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
isRenovatePR: ${{ startsWith(steps.branch-name.outputs.current_branch, 'renovate/') }}
|
|
|
|
isFork: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
|
|
|
|
steps:
|
|
|
|
- name: Get branch name
|
|
|
|
id: branch-name
|
2022-03-30 16:50:03 +00:00
|
|
|
uses: tj-actions/branch-names@9cd06d955f4184031cd71fbb1717ac268ade2ee0 # tag=v5.2
|
2022-03-30 08:46:56 +00:00
|
|
|
|
|
|
|
- name: Save PR data to file
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
|
|
run: |
|
|
|
|
echo $PR_NUMBER > pr_number.txt
|
|
|
|
|
|
|
|
- name: Store pr data in artifact
|
2022-05-20 18:26:29 +00:00
|
|
|
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
2022-03-30 08:46:56 +00:00
|
|
|
with:
|
|
|
|
name: pr_metadata
|
|
|
|
path: ./pr_number.txt
|
|
|
|
retention-days: 5
|
|
|
|
|
|
|
|
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
|
2022-04-22 19:28:18 +00:00
|
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2022-03-30 08:46:56 +00:00
|
|
|
|
|
|
|
- name: Collect changes
|
|
|
|
id: collect-changes
|
|
|
|
uses: ./.github/actions/collect-changes
|