forked from wpengine/faustjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create manually dispatched workflow for testing (wpengine#721)
- Loading branch information
1 parent
b43d713
commit 1c2b88a
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
async function mergeToMain({github, context}) { | ||
console.log("TEST: Merging canary to main..."); | ||
|
||
const result = await github.rest.repos.merge({ | ||
...context.repo, | ||
base: "TEST_main", | ||
head: "TEST_canary", | ||
commit_message: "TEST: Merge release from branch `canary` into `main`" | ||
}); | ||
|
||
return result; | ||
} | ||
|
||
module.exports = { | ||
mergeToMain | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Post-release jobs | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
published: | ||
description: "Simulates whether changesets did or did not publish a release." | ||
required: true | ||
default: "false" | ||
|
||
jobs: | ||
simulate_output: | ||
name: "Simulate changesets/action output" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
published: ${{ steps.step1.outputs.published }} | ||
steps: | ||
- id: step1 | ||
run: echo "::set-output name=published::${{ github.event.inputs.published }}" | ||
merge_to_main: | ||
name: "Merge `canary` into `main`" | ||
runs-on: ubuntu-latest | ||
needs: simulate_output | ||
if: ${{ needs.simulate_output.outputs.published == 'true' }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Merge to main | ||
uses: actions/github-script@v5 | ||
with: | ||
script: | | ||
const { mergeToMain } = require('.github/actions/post-release/index.js') | ||
return await mergeToMain({github, context}) |