-
Notifications
You must be signed in to change notification settings - Fork 2k
75 lines (64 loc) · 2.47 KB
/
official-pr.yml
File metadata and controls
75 lines (64 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Create official images PR
on:
pull_request_target:
types:
- closed
paths:
- ".github/workflows/official-pr.yml"
- "**/Dockerfile"
- "**/architectures"
- "**/docker-entrypoint.sh"
- "generate-stackbrew-library.sh"
- "functions.sh"
jobs:
pr:
runs-on: ubuntu-latest
if: github.repository_owner == 'nodejs' && github.event.pull_request.merged_by != ''
steps:
- name: Checkout the docker-node repo
uses: actions/checkout@v2
with:
path: docker-node
ref: ${{ github.base_ref }}
fetch-depth: 50
- name: Checkout the official-images repo
uses: actions/checkout@v2
with:
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
with:
token: ${{ secrets.GH_API_TOKEN }}
push-to-fork: nodejs-github-bot/official-images
path: official-images
branch: node
title: "Node: ${{ github.event.pull_request.title }}"
body: |
Pull Request: ${{ github.event.pull_request.html_url }}
@LaurentGoderre @pesho @PeterDaveHello @SimenB @Starefossen
- name: Create PR comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
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: failure()
uses: crazy-max/ghaction-dump-context@v1