diff --git a/.github/workflows/official-pr.yml b/.github/workflows/official-pr.yml index e9af41d16..3db630948 100644 --- a/.github/workflows/official-pr.yml +++ b/.github/workflows/official-pr.yml @@ -32,11 +32,24 @@ jobs: path: official-images repository: docker-library/official-images + - name: Track official images fork + run: | + cd official-images + git remote add fork https://github.com/nodejs-github-bot/official-images + git fetch fork + git checkout -b node --track fork/node + - name: Generate Stackbrew for diff run: | cd docker-node ./generate-stackbrew-library.sh > ../official-images/library/node + - name: Commit Stackbrew changes + run: | + cd official-images + git add -A + git diff-index --quiet HEAD || git commit -m "Node: ${{ github.event.pull_request.title }}" --author="${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" + - name: Create PR in official-images id: create-pr uses: peter-evans/create-pull-request@v3 @@ -45,17 +58,11 @@ jobs: push-to-fork: nodejs-github-bot/official-images path: official-images branch: node - commit-message: "Node: ${{ github.event.pull_request.title }}" title: "Node: ${{ github.event.pull_request.title }}" body: | Pull Request: ${{ github.event.pull_request.html_url }} @LaurentGoderre @pesho @PeterDaveHello @SimenB @Starefossen - - name: PR details - run: | - echo "Pull Request Number - ${{ steps.create-pr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.create-pr.outputs.pull-request-url }}" - - name: Create PR comment uses: peter-evans/create-or-update-comment@v1 with: @@ -64,5 +71,5 @@ jobs: Created PR on the official-images repo (${{ steps.create-pr.outputs.pull-request-url }}). See https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what if you are wondering when it will be available on the Docker Hub. - name: Dump context - if: always() + if: failure() uses: crazy-max/ghaction-dump-context@v1