Skip to content

Commit 8fc2aed

Browse files
paketo-botpaketo-bot
authored andcommitted
Update github-config to 29f5ef3
1 parent c744502 commit 8fc2aed

File tree

3 files changed

+74
-10
lines changed

3 files changed

+74
-10
lines changed

.github/workflows/auto-merge.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Auto-Merge
2+
3+
on:
4+
pull_request_review:
5+
types:
6+
- submitted
7+
8+
jobs:
9+
pull_request:
10+
name: Fetch Pull Request Details
11+
if: ${{ github.event.review.user.login == 'paketo-bot-reviewer' }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Fetch
15+
id: fetch
16+
env:
17+
NUMBER: ${{ github.event.pull_request.number }}
18+
GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
19+
run: |
20+
payload="$(
21+
curl "https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${NUMBER}" \
22+
--silent \
23+
--location \
24+
--header "Authorization: token ${GITHUB_TOKEN}"
25+
)"
26+
27+
echo "::set-output name=mergeable_state::$(echo "${payload}" | jq -r -c .mergeable_state)"
28+
outputs:
29+
mergeable_state: ${{ steps.fetch.outputs.mergeable_state }}
30+
31+
merge:
32+
name: Merge
33+
needs: pull_request
34+
if: ${{ needs.pull_request.outputs.mergeable_state == 'clean' }}
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v2
39+
40+
- name: Merge
41+
uses: paketo-buildpacks/github-config/actions/pull-request/merge@main
42+
with:
43+
user: paketo-bot
44+
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
45+
number: ${{ github.event.pull_request.number }}
46+
47+
rebase:
48+
name: Rebase
49+
needs: pull_request
50+
if: ${{ needs.pull_request.outputs.mergeable_state == 'behind' }}
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v2
55+
56+
- name: Rebase
57+
uses: paketo-buildpacks/github-config/actions/pull-request/rebase@main
58+
with:
59+
user: paketo-bot
60+
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
61+
number: ${{ github.event.pull_request.number }}

.github/workflows/create-draft-release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,20 @@ jobs:
2525
runs-on: ubuntu-latest
2626
needs: integration
2727
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
2831
- name: Reset Draft Release
32+
id: reset
2933
uses: paketo-buildpacks/github-config/actions/release/reset-draft@main
3034
with:
3135
repo: ${{ github.repository }}
3236
token: ${{ github.token }}
33-
- name: Checkout
34-
uses: actions/checkout@v2
35-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
3637
- name: Tag
3738
id: tag
3839
uses: paketo-buildpacks/github-config/actions/tag@main
40+
with:
41+
current_version: ${{ steps.reset.outputs.current_version }}
3942
- name: Package
4043
run: ./scripts/package.sh --version "${{ steps.tag.outputs.tag }}"
4144
- name: Create Release Notes

.github/workflows/test-pull-request.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@ jobs:
1414
uses: actions/setup-go@v1
1515
with:
1616
go-version: 1.14
17+
1718
- name: Checkout
1819
uses: actions/checkout@v2
20+
1921
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
22+
2023
- name: Run Integration Tests
2124
run: ./scripts/integration.sh
2225

2326
approve:
2427
name: Auto Approve
28+
if: ${{ github.event.pull_request.user.login == 'paketo-bot' || github.event.pull_request.user.login == 'dependabot[bot]' }}
2529
runs-on: ubuntu-latest
2630
needs: integration
2731
steps:
28-
- name: Parse Author and Number
29-
id: event
30-
run: |
31-
echo "::set-output name=author::$(jq -r .pull_request.user.login ${{ github.event_path }})"
32-
echo "::set-output name=number::$(jq -r .number ${{ github.event_path }})"
3332
- name: Checkout
3433
uses: actions/checkout@v2
34+
3535
- name: Approve
3636
uses: paketo-buildpacks/github-config/actions/pull-request/approve@main
3737
with:
3838
user: paketo-bot-reviewer
3939
token: ${{ secrets.PAKETO_BOT_REVIEWER_GITHUB_TOKEN }}
40-
author: ${{ steps.event.outputs.author }}
41-
number: ${{ steps.event.outputs.number }}
40+
author: ${{ github.event.pull_request.user.login }}
41+
number: ${{ github.event.number }}

0 commit comments

Comments
 (0)