Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temurin archive updater action #1652

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading