Files
pezkuwi-subquery/.github/workflows/deploy.yml
T
Satoshi Qazi Muhammed 07facbdda2 fix(ci): pass workflow_run head_branch through env; read-only tokens
auto-merge.yml interpolated ${{ github.event.workflow_run.head_branch }} straight into a run script that holds a contents:write token. A fork pull request controls that branch name, so it could run commands with write access (CodeQL actions/code-injection/critical). It now arrives as an environment variable.

ci.yml, code-quality.yml and deploy.yml get permissions: contents: read; none of them writes through GITHUB_TOKEN.
2026-10-20 22:07:02 +04:00

82 lines
2.1 KiB
YAML

name: Deploy to SubQuery Network
on:
release:
types: [published]
workflow_dispatch:
inputs:
project:
description: 'Project to deploy'
required: true
default: 'all'
type: choice
options:
- all
- pezkuwi
- pezkuwi-assethub
env:
SUBQL_ACCESS_TOKEN: ${{ secrets.SUBQL_ACCESS_TOKEN }}
# Read-only token: these jobs never write through GITHUB_TOKEN.
permissions:
contents: read
jobs:
deploy-pezkuwi:
if: ${{ github.event_name == 'release' || github.event.inputs.project == 'all' || github.event.inputs.project == 'pezkuwi' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Generate types
run: ./node_modules/.bin/subql codegen pezkuwi.yaml
- name: Build
run: ./node_modules/.bin/subql build pezkuwi.yaml
- name: Publish Pezkuwi Relay
run: ./node_modules/.bin/subql publish -f pezkuwi.yaml
deploy-assethub:
if: ${{ github.event_name == 'release' || github.event.inputs.project == 'all' || github.event.inputs.project == 'pezkuwi-assethub' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Generate types
run: ./node_modules/.bin/subql codegen pezkuwi.yaml
- name: Build
run: ./node_modules/.bin/subql build pezkuwi.yaml
- name: Publish Pezkuwi Asset Hub
run: ./node_modules/.bin/subql publish -f pezkuwi-assethub.yaml