Skip to content

Commit

Permalink
Merge pull request #1652 from GoogleContainerTools/add-java-update-ac…
Browse files Browse the repository at this point in the history
…tion

Add temurin archive updater action
  • Loading branch information
loosebazooka authored Aug 29, 2024
2 parents f5133c2 + ae680f3 commit dad24cb
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/update-temurin-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: update-snapshots
on:
# will send emails to last editor of this cron syntax (distroless-bot)
schedule:
- cron: "35 20 * * *"
# allow this workflow to be manually run
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Update snapshots
run: ./knife update-java-archives

- name: Create commits
if: env.DISTROLESS_DIFF
id: create-commits
run: |
git checkout -b update-java-archives
# Set identity.
git config --global user.email "[email protected]"
git config --global user.name "Distroless Bot"
# Commit changes
git add .
git commit -s -m "Bumping temurin archives to latest stable versions"
git push --force origin HEAD
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
run: |
BODY_FILE=$(mktemp)
if ! OUTPUT=$(gh pr create -B main -H update-snapshots -t "Bumping temurin archives to latest stable versions" 2>&1) ; then
echo $OUTPUT
if [[ "${OUTPUT}" =~ "already exists" ]]; then
echo "PR already exists and it was updated. Ending successfully";
exit 0;
else
exit 1;
fi
fi

0 comments on commit dad24cb

Please sign in to comment.