Skip to content

Commit

Permalink
make branch a string
Browse files Browse the repository at this point in the history
  • Loading branch information
markdoeswork committed May 9, 2024
1 parent 19b3a55 commit 558814a
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/nitro-alpha.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
name: Create PR in Nitro
name: create pr in nitro

on:
pull_request:
types: [labeled]

jobs:
triggerOnLabel:
triggeronlabel:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'Nitro')
if: contains(github.event.pull_request.labels.*.name, 'nitro')
steps:
- name: Checkout code
- name: checkout code
uses: actions/checkout@v2

- name: Setup Git
- name: setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git config --global user.name "your name"
- name: Generate branch name
- name: generate branch name
id: branch_name
run: |
echo "Original branch: ${GITHUB_REF#refs/heads/}"
NEW_BRANCH="${GITHUB_REF#refs/heads/}_alpha"
echo "::set-output name=branch::${NEW_BRANCH}"
echo "original branch: ${github_ref#refs/heads/}"
new_branch="${github_ref#refs/heads/}_alpha"
echo "::set-output name=branch::${new_branch}"
- name: Create new branch in Nitro
- name: create new branch in nitro
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.github_token }}
script: |
const repo = 'nitro-web';
const owner = 'powerhome';
const branch = ${{ steps.branch_name.outputs.branch }};
// Correct the branch definition by using a string
const branch = 'refs/pull/3398/merge_alpha';
const mainSha = await github.rest.repos.getBranch({
owner,
repo,
Expand All @@ -44,13 +45,13 @@ jobs:
sha: mainSha
});
- name: Create Pull Request in Nitro
- name: create pull request in nitro
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ steps.branch_name.outputs.branch }}
destination_branch: "master" # Default branch in Nitro
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Automated PR from Repo A"
pr_body: "This is an automated pull request."
destination_branch: "master"
github_token: ${{ secrets.github_token }}
pr_title: "automated pr from repo a"
pr_body: "this is an automated pull request."
destination_repo: "powerhome/nitro-web"

0 comments on commit 558814a

Please sign in to comment.