releasehub-com / github-action-create-pr-parent-submodule Goto Github PK
View Code? Open in Web Editor NEWGitHub Action to Create Pull Request in Parent Repository when Submodules are Updated
GitHub Action to Create Pull Request in Parent Repository when Submodules are Updated
Hi, this is my .yml
and I already set my secrets.
name: Submodule Updates
#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [master, main]
pull_request:
branches: [master, main]
###############
# Set the Job #
###############
jobs:
build:
name: Submodule update
runs-on: ubuntu-latest
env:
PARENT_REPOSITORY: '<org>/repo-name'
CHECKOUT_BRANCH: 'main'
PR_AGAINST_BRANCH: 'main'
OWNER: <org>
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
####################################
# Run the action against code base #
####################################
- name: run action
id: run_action
uses: releasehub-com/github-action-create-pr-parent-submodule@v1
with:
github_token: ${{ secrets.RELEASE_HUB_SECRET }}
parent_repository: ${{ env.PARENT_REPOSITORY }}
checkout_branch: ${{ env.CHECKOUT_BRANCH}}
pr_against_branch: ${{ env.PR_AGAINST_BRANCH }}
owner: ${{ env.OWNER }}
And I get this error, any idea what's causing this?
Fetching the repository
/usr/bin/git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin +refs/heads/:refs/remotes/origin/ +refs/tags/:refs/tags/
Error: fatal: could not read Username for 'https://github.com/': terminal prompts disabled
The process '/usr/bin/git' failed with exit code 128
Waiting 10 seconds before trying again
I received the following warning when running this in my GH Action:
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/github-script@v5. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
It appears you can fix this by updating three lines in the actions.yml:
Line 35: change to actions/checkout@v4
Line 54: change to actions/github-script@v6
Line 68: change to actions/github-script@v6
Currently I do get an exit code 1. I'm not sure if my setup is somehow wrong and how I can further troubleshoot the following issue:
Run git config user.name github-actions
git config user.name github-actions
git config user.email [email protected]
git submodule update --remote
git checkout -b $GITHUB_RUN_ID
git commit -am "updating submodules"
git push --set-upstream origin $GITHUB_RUN_ID
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
PARENT_REPOSITORY: <org>/<repo>
CHECKOUT_BRANCH: main
PR_AGAINST_BRANCH: main
OWNER: <org>
Switched to a new branch '2140478299'
On branch 2140478299
nothing to commit, working tree clean
Error: Process completed with exit code 1.
My action:
name: 'submodule update'
# When to start the job
on:
push:
branches: [main]
pull_request:
branches: [main]
# Run the job
jobs:
build:
runs-on: ubuntu-latest
env:
PARENT_REPOSITORY: '<org>/<repo>'
CHECKOUT_BRANCH: 'main'
PR_AGAINST_BRANCH: 'main'
OWNER: '<org>'
steps:
- name: checkout code
uses: actions/checkout@v2
- name: run action
id: run_action
uses: releasehub-com/github-action-create-pr-parent-submodule@v1
with:
github_token: ${{ secrets.SUBMODULE_UPDATE_SECRET }}
parent_repository: ${{ env.PARENT_REPOSITORY }}
checkout_branch: ${{ env.CHECKOUT_BRANCH}}
pr_against_branch: ${{ env.PR_AGAINST_BRANCH }}
owner: ${{ env.OWNER }}
I've also walked again via the nice post at https://thenewstack.io/how-to-trigger-github-actions-on-submodule-updates/ but still not finding the root cause.
Many thanks.
Hi,
It would be nice to be able to specify a reviewer to the made pull request, as it would notify the needed people.
Hi,
Currently if the CHECKOUT_BRANCH
doesn't exist, the workflow fail. However, a base branch (from which to create the checkout branch) could be specified so that the workflow doesn't fail. Is this something you could see fitting in this action?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.