|
| 1 | +name: Create official images PR |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request_target: |
| 5 | + types: |
| 6 | + - closed |
| 7 | + |
| 8 | + paths: |
| 9 | + - "**/Dockerfile" |
| 10 | + - "**/architectures" |
| 11 | + - "**/docker-entrypoint.sh" |
| 12 | + - "generate-stackbrew-library.sh" |
| 13 | + - "functions.sh" |
| 14 | + |
| 15 | +jobs: |
| 16 | + pr: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + if: github.repository_owner == 'nodejs' && github.event.pull_request.merged_by != '' |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout the docker-node repo |
| 22 | + uses: actions/checkout@v2 |
| 23 | + with: |
| 24 | + path: docker-node |
| 25 | + fetch-depth: 50 |
| 26 | + |
| 27 | + - name: Checkout the official-images repo |
| 28 | + uses: actions/checkout@v2 |
| 29 | + with: |
| 30 | + path: official-images |
| 31 | + repository: docker-library/official-images |
| 32 | + |
| 33 | + - name: Generate Stackbrew for diff |
| 34 | + run: | |
| 35 | + cd docker-node |
| 36 | + ./generate-stackbrew-library.sh > ../official-images/library/node |
| 37 | +
|
| 38 | + - name: Create PR in official-images |
| 39 | + id: create-pr |
| 40 | + uses: peter-evans/create-pull-request@v3 |
| 41 | + with: |
| 42 | + token: ${{ secrets.GH_API_TOKEN }} |
| 43 | + push-to-fork: nodejs-github-bot/official-images |
| 44 | + path: official-images |
| 45 | + branch: node |
| 46 | + commit-message: "Node: ${{ github.event.pull_request.title }}" |
| 47 | + title: "Node: ${{ github.event.pull_request.title }}" |
| 48 | + body: | |
| 49 | + Pull Request: ${{ github.event.pull_request.html_url }} |
| 50 | + @LaurentGoderre @pesho @PeterDaveHello @SimenB @Starefossen |
| 51 | +
|
| 52 | + - name: PR details |
| 53 | + run: | |
| 54 | + echo "Pull Request Number - ${{ steps.create-pr.outputs.pull-request-number }}" |
| 55 | + echo "Pull Request URL - ${{ steps.create-pr.outputs.pull-request-url }}" |
| 56 | +
|
| 57 | + - name: Create PR comment |
| 58 | + uses: peter-evans/create-or-update-comment@v1 |
| 59 | + with: |
| 60 | + issue-number: ${{ github.event.pull_request.number }} |
| 61 | + body: | |
| 62 | + 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. |
0 commit comments