app-store/.github/workflows/renovate-app-version.yml

62 lines
1.9 KiB
YAML
Raw Normal View History

2022-10-13 17:05:19 +00:00
name: Update app version in Renovate Branches
on:
2023-06-20 22:05:11 +00:00
pull_request:
types:
- labeled
- opened
- edited
- assigned
- synchronize
- reopened
- unlocked
- ready_for_review
2022-10-13 17:05:19 +00:00
jobs:
update-app-version:
2023-06-20 22:17:21 +00:00
if: github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'renovate')
2022-10-13 17:05:19 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
2022-10-13 21:54:10 +00:00
with:
fetch-depth: 0
2022-10-13 17:05:19 +00:00
- name: Configure repo
run: |
git config --local user.email "githubaction@githubaction.com"
git config --local user.name "github-action update-app-version"
- name: Get list of updated files by the last commit in this branch separated by space
id: updated-files
2022-10-13 17:05:19 +00:00
run: |
echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Run renovate-app-version.sh on updated files
run: |
IFS=' ' read -ra files <<< "${{ steps.updated-files.outputs.files }}"
for file in "${files[@]}"; do
if [[ $file == *"docker-compose.yml"* ]]; then
app_name=$(echo $file | cut -d'/' -f 2)
./.github/workflows/renovate-app-version.sh $app_name
fi
done
2022-10-13 17:05:19 +00:00
- name: Commit & Push Changes
run: |
2023-06-20 22:05:11 +00:00
git add "apps/*/config.json" && git commit -m "chore: update config.json version" --no-edit --no-verify && git push || true
2023-06-20 21:35:42 +00:00
- name: Label this PR as "ready"
if: github.event_name == 'pull_request'
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["ready"]
})