Skip to content

Commit

Permalink
[WORKFLOWS] Fix Subgraph Versions Check (#1506)
Browse files Browse the repository at this point in the history
* use different check version logic

* fix bash

* only query when subgraph endpoints exist
  • Loading branch information
0xdavinchee authored Jul 12, 2023
1 parent c99f6f9 commit 3cd1f8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/cd.packages-stable.create-release-drafts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,16 @@ jobs:
registry-url: https://registry.npmjs.org/

- name: Check package versions
run: ./tasks/check-package-version.sh subgraph SHOULD_PUBLISH_SUBGRAPH SUBGRAPH_NEW_VERSION >> "$GITHUB_ENV"
run: |
SUBGRAPH_NEW_VERSION=$(jq -r .version packages/subgraph/package.json)
if git tag | grep -e "^subgraph@v${SUBGRAPH_NEW_VERSION}$";then
echo "subgraph version unchanged: $SUBGRAPH_NEW_VERSION" >&2
echo "SHOULD_PUBLISH_SUBGRAPH=0" >> "$GITHUB_ENV"
else
echo "subgraph changed: $SUBGRAPH_NEW_VERSION" >&2
echo "SHOULD_PUBLISH_SUBGRAPH=1" >> "$GITHUB_ENV"
echo "SUBGRAPH_NEW_VERSION=$NEW_SUBGRAPH_VERSION" >> "$GITHUB_ENV"
fi
- name: Create subgraph stable release draft
if: env.SHOULD_PUBLISH_SUBGRAPH == 1
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-core/test/5_subgraph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ describe("Subgraph Tests", () => {
if (process.env.SUBGRAPH_ENDPOINT === "") {
await Promise.all(
resolverDataArray.map(async (x) => {
// @note skip eth-sepolia because it is not deployed on hosted-service
if (x.networkName !== "eth-sepolia") {
// @note skip networks without subgraph endpoints
if (x.subgraphAPIEndpoint !== "") {
const query = new Query({
customSubgraphQueriesEndpoint:
x.subgraphAPIEndpoint,
Expand Down

0 comments on commit 3cd1f8a

Please sign in to comment.