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 updater github action #558

Merged
merged 4 commits into from
Apr 29, 2021
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
46 changes: 46 additions & 0 deletions .github/workflows/updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Updater

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # every week
push:
branches:
- master

jobs:
updater:
if: startsWith(github.repository, 'AdoptOpenJDK/')
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
with:
repository: adoptopenjdk-github-bot/openjdk-docker
token: ${{ secrets.ACCESS_TOKEN }}
ssh-key: ${{ secrets.ADOPT_BOT_SSH_PRIVATE }}

- name: Setup Git repos
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git remote rename origin fork
git remote add upstream https://github.com/AdoptOpenJDK/openjdk-docker.git
git remote -v
git fetch --all
git reset --hard upstream/master

- name: Run updater
run: |
BRANCH=$(date +"%Y-%m-%d")
git fetch --all
git checkout "$BRANCH" || git checkout -b "$BRANCH"
git reset --hard upstream/master
bash update_all.sh
git add .
git commit -m "dockerfile updates $BRANCH"
git push -f fork "$BRANCH"
hub pull-request --base adoptopenjdk:master --head "$BRANCH" -m "update Dockerfiles"
env:
GITHUB_USER: adoptopenjdk-github-bot
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}