Skip to content

Commit 35adb03

Browse files
committed
chore: create a pull request against our bcr fork on successful release
1 parent 80603fb commit 35adb03

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/bcr-fork.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# GitHub Actions workflow to create a pull request to our fork of the bazel central
2+
# registry after a successful release.
3+
4+
name: BCR-FORK
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
env:
11+
BCR_FORK: aspect-build/bazel-central-registry
12+
13+
jobs:
14+
bcr-pull-request:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: "14"
20+
- name: Get the tag
21+
id: get_tag
22+
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
23+
- name: Checkout this repo to access scripts
24+
uses: actions/checkout@v3
25+
- name: Checkout the released version of this repo
26+
uses: actions/checkout@v3
27+
with:
28+
ref: ${{ env.GITHUB_REF }}
29+
path: project
30+
- name: Checkout bcr
31+
uses: actions/checkout@v3
32+
with:
33+
repository: ${{ env.BCR_FORK }}
34+
path: bcr
35+
- name: Create bcr entry
36+
run: node .github/workflows/create-bcr-entry.mjs project bcr $GITHUB_REPOSITORY ${{ steps.get_tag.outputs.TAG }}
37+
- name: Create Pull Request (BCR)
38+
id: post_pr
39+
uses: peter-evans/create-pull-request@v4
40+
with:
41+
token: ${{ secrets.DEREK_BCR_PAT }}
42+
path: bcr
43+
commit-message: ${{ github.repository }}@${{ steps.get_tag.outputs.TAG }}-fork
44+
branch: ${{ github.repository }}@${{ steps.get_tag.outputs.TAG }}-fork
45+
title: ${{ github.repository }}@${{ steps.get_tag.outputs.TAG }}
46+
assignees: ${{ github.actor }}
47+
body: |
48+
[Automated] Publish ${{ github.repository }}@${{ steps.get_tag.outputs.TAG }}.
49+
- name: Echo PR url
50+
run: echo ${{ steps.post_pr.outputs.pull-request-url }}

0 commit comments

Comments
 (0)