Skip to content

simplify and omit release when GITHUB_TOKEN not present #17

simplify and omit release when GITHUB_TOKEN not present

simplify and omit release when GITHUB_TOKEN not present #17

Workflow file for this run

name: build
on:
push:
branches: [main, next]
pull_request:
types: [opened, synchronize, reopened]
# Enabled permissions on GITHUB_TOKEN
permissions:
# To be able to push to the repo
contents: write
# To update the pr description with canary info
pull-requests: write
# For pr-check to create a status
statuses: write
# Needed to create PR statuses/checks
checks: write
# To post comments on PRs
issues: write
jobs:
# Run install in one step so deps can be cached for other steps
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
build:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v4
- name: Prepare repository
run: git fetch --unshallow --tags
- uses: ./.github/actions/setup
- uses: ./.github/actions/build-cache
- run: yarn build
# - run: yarn build && yarn lerna run bundle --scope=auto
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# pr-check:
# runs-on: ubuntu-latest
# needs: build
# if: ${{ env.GITHUB_TOKEN != '' }}
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/setup
# - uses: ./.github/actions/build-cache
# - uses: 8BitJonny/[email protected]
# id: PR
# - run: yarn auto pr-check --pr $PR --url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
# env:
# PR: ${{ steps.PR.outputs.number }}
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# lint:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/setup
# - uses: ./.github/actions/build-cache
# - run: yarn lint
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/build-cache
- name: Prepare repository
run: git fetch --unshallow --tags
- run: yarn test
# - run: yarn test:coverage
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# - name: Send CodeCov Results
# run: bash <(curl -s https://codecov.io/bash) -t $CODECOV_KEY
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release:
runs-on: ubuntu-latest
needs: build
if: "env.GITHUB_TOKEN != '' && !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"

Check failure on line 96 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 96, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GITHUB_TOKEN != '' && !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')
steps:
- uses: actions/checkout@v4
# - uses: 8BitJonny/[email protected]
# id: PR
# with:
# filterOutClosed: true
# sha: ${{ github.event.pull_request.head.sha }}
- uses: ./.github/actions/setup
- uses: ./.github/actions/build-cache
- name: Prepare repository
run: git fetch --unshallow --tags
- name: Create Release
run: yarn auto shipit -vv
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PROTECTED_BRANCH_REVIEWER_TOKEN: ${{ secrets.GH_TOKEN }}
# PR: ${{ steps.PR.outputs.number }}