Skip to content

Commit ba116ff

Browse files
paketo-botpaketo-bot
authored andcommitted
Update github-config to 220b087
1 parent 2a77c16 commit ba116ff

2 files changed

Lines changed: 23 additions & 56 deletions

File tree

Lines changed: 22 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,43 @@
1-
name: Update Buildpack Dependency
1+
name: Update buildpack.toml
22

33
on:
4-
repository_dispatch:
5-
types: dependency-update
4+
schedule:
5+
- cron: '*/15 * * * *'
6+
push:
7+
branches:
8+
- main
69

710
jobs:
811
update-buildpack-toml:
912
runs-on: ubuntu-latest
1013
name: Update buildpack.toml
1114
steps:
1215

13-
- name: Parse ID and Version
14-
id: dependency
15-
run: |
16-
echo "::set-output name=id::$(jq -r .client_payload.dependency.id ${{ github.event_path }})"
17-
echo "::set-output name=version::$(jq -r .client_payload.dependency.version ${{ github.event_path }})"
18-
1916
- name: Checkout
2017
uses: actions/checkout@v2
2118

2219
- name: Checkout Branch
23-
run: |
24-
branch="automation/dependency-update/${{ steps.dependency.outputs.id }}"
25-
git fetch origin
26-
if git branch -a | grep "${branch}"; then
27-
git checkout -b "${branch}" "origin/${branch}"
28-
git pull -r
29-
else
30-
git checkout -b "${branch}"
31-
fi
20+
uses: paketo-buildpacks/github-config/actions/pull-request/checkout-branch@main
21+
with:
22+
branch: automation/buildpack.toml/update
3223

3324
- name: Update buildpack.toml
34-
uses: paketo-buildpacks/github-config/actions/dependency/update@main
25+
uses: paketo-buildpacks/github-config/actions/buildpack/update@main
3526

3627
- name: Commit
37-
run: |
38-
git config --global user.email "[email protected]"
39-
git config --global user.name "paketo-bot"
40-
git commit \
41-
--all \
42-
--message "Updating ${{ steps.dependency.outputs.id }} to ${{ steps.dependency.outputs.version }} in buildpack.toml"
28+
uses: paketo-buildpacks/github-config/actions/pull-request/create-commit@main
29+
with:
30+
message: "Updating buildpacks in buildpack.toml"
31+
pathspec: "."
4332

4433
- name: Push Branch
45-
run: |
46-
git remote add origin-ssh "[email protected]:${{ github.repository }}.git"
47-
eval "$(ssh-agent)"
48-
echo "${{ secrets.PAKETO_BOT_SSH_KEY }}" | ssh-add -
49-
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git \
50-
push origin "automation/dependency-update/${{ steps.dependency.outputs.id }}"
34+
uses: paketo-buildpacks/github-config/actions/pull-request/push-branch@main
35+
with:
36+
branch: automation/buildpack.toml/update
5137

5238
- name: Open Pull Request
53-
run: |
54-
branch="automation/dependency-update/${{ steps.dependency.outputs.id }}"
55-
org="$(echo "${GITHUB_REPOSITORY}" | cut -d'/' -f1)"
56-
count="$(
57-
curl "https://api.github.com/repos/${{ github.repository }}/pulls?head=${org}:${branch}" \
58-
-H "Authorization: token ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}" \
59-
--silent \
60-
| jq -r 'length'
61-
)"
62-
63-
if [[ "${count}" != "0" ]]; then
64-
echo "PR already exists, updated with new commit."
65-
exit 0
66-
fi
67-
68-
curl "https://api.github.com/repos/${{ github.repository }}/pulls" \
69-
-H "Authorization: token ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}" \
70-
-X POST \
71-
--data '{
72-
"head": "automation/dependency-update/${{ steps.dependency.outputs.id }}",
73-
"base": "main",
74-
"title": "Updates ${{ steps.dependency.outputs.id }}"
75-
}'
76-
39+
uses: paketo-buildpacks/github-config/actions/pull-request/open@main
40+
with:
41+
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
42+
title: "Updates buildpacks in buildpack.toml"
43+
branch: automation/buildpack.toml/update

scripts/.util/tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function util::tools::pack::install() {
9595

9696
if [[ ! -f "${dir}/pack" ]]; then
9797
local version
98-
version="v0.14.2"
98+
version="v0.15.0"
9999

100100
util::print::title "Installing pack ${version}"
101101
curl "https://github.com/buildpacks/pack/releases/download/${version}/pack-${version}-${os}.tgz" \

0 commit comments

Comments
 (0)