-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(OS-798): fixes 2 bugs in subgraph and npm releated workflows (#491)
* ci: wrong comparison in npm-release workflow * ci: possible fix for subgraph deploy issue updating the changelog requires a commit that needs to be signed, github actions cannot do that easily. this is a possible solution for this problem
- Loading branch information
1 parent
835b398
commit 4f9efb4
Showing
2 changed files
with
15 additions
and
13 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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
name: Subgraph Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- closed | ||
|
@@ -13,6 +13,7 @@ on: | |
- main | ||
paths: | ||
- 'packages/subgraph/package.json' | ||
- '.github/workflows/subgraph-deploy.yaml' | ||
|
||
jobs: | ||
# The prepare job is responsible for preparing the environment and generating outputs for other jobs. | ||
|
@@ -37,6 +38,10 @@ jobs: | |
github.event.pull_request.merged && | ||
github.actor != 'arabot-1' && | ||
contains(toJson(github.event.pull_request.labels.*.name), 'subgraph:deploy') | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
@@ -46,17 +51,14 @@ jobs: | |
run: | | ||
VERSION=$(cat package.json | jq -r .version) | ||
sed -i "s/^\#\# \[UPCOMING\]/## [UPCOMING]\n\n\## $VERSION\nOn $(date +'%Y-%m-%d %H:%M:%S')/" "./CHANGELOG.md" | ||
- name: Commit changes | ||
id: commit | ||
run: | | ||
git fetch | ||
git pull | ||
git config --global user.name "Arabot-1" | ||
git config --global user.email "[email protected]" | ||
git add packages/subgraph/CHANGELOG.md | ||
git commit -am "Update changelog in subgraph" | ||
git push | ||
- uses: planetscale/[email protected] | ||
with: | ||
commit_message: 'Update changelog in subgraph' | ||
repo: ${{ github.repository }} | ||
branch: ${{ github.head_ref || github.ref_name }} | ||
file_pattern: 'packages/subgraph/CHANGELOG.md' | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
# The build-deploy job builds and deploys the subgraph. | ||
# It depends on the prepare and changelog jobs to complete successfully, | ||
|