Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/submodule-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Open PRs to Submodules

on:
pull_request:
branches:
- master

jobs:
build:
name: Open PRs on changes to submodules
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Submodules
run: |
sed -i -Ee's#git@github.com:([^/]*)/(.*).git#https://github.com/\1/\2.git#' .gitmodules
git submodule init
git submodule update

- name: Create Pull Request
shell: bash
id: create-pr
run: |
git submodule foreach '
TARGET=$(git rev-parse --short master)
CURRENT=$(git rev-parse --short HEAD)

if [ "$CURRENT" = "$TARGET" ]; then
echo "No updates to $name"
else
# get the current branch that represents head
BRANCH=$(git ls-remote --heads origin | grep $(git rev-parse HEAD) | cut -d / -f 3)
BODY="{\"title\":\"Integrations: $BRANCH - ${{ github.head_ref }}\",\"head\":\"$BRANCH\",\"base\":\"master\",\"body\":\"Automated PR\"}"
curl --silent \
-X POST \
-H "authorization: Bearer ${{ secrets.PULL_REQUEST_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/ethereum-optimism/$name/pulls \
-d "$BODY" || true
fi;
'
2 changes: 1 addition & 1 deletion go-ethereum
Submodule go-ethereum updated 1 files
+1 −0 file.txt