Skip to content

Bump json5 from 1.0.1 to 1.0.2 #89

Bump json5 from 1.0.1 to 1.0.2

Bump json5 from 1.0.1 to 1.0.2 #89

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
paths:
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
package: ${{ steps.changes.outputs.package }}
steps:
- run: cat $GITHUB_EVENT_PATH
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
- uses: dorny/paths-filter@v2.11.1
id: changes
with:
filters: |
package:
- .github/workflows/ci.yml
- dist/**
- src/**
- action.yml
- package-lock.json
- package.json
package:
needs: [ paths ]
if: needs.paths.outputs.package == 'true' && github.event_name == 'pull_request'
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- id: generate_token
uses: tibdex/github-app-token@v1.7.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
ref: ${{ github.head_ref }}
- run: npm install
- run: npm run format
- run: npm run build
- run: npm run lint
- run: npm test
env:
CONSUMER_API_KEY: ${{ secrets.CONSUMER_API_KEY }}
CONSUMER_API_SECRET_KEY: ${{ secrets.CONSUMER_API_SECRET_KEY }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
- run: npm run package
- name: Diff
id: diff
run: |
git status
git add -N .
git diff --name-only --exit-code
continue-on-error: true
- uses: snow-actions/git-config-user@v1.0.0
if: steps.diff.outcome == 'failure'
- name: Commit & Push
run: |
git add .
git commit -m 'npm run package'
git push
exit 1
if: steps.diff.outcome == 'failure'
test:
needs:
- paths
- package # Save API rate limit
if: >-
failure() == false &&
cancelled() == false &&
needs.paths.outputs.package == 'true'
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Only latest for saving API rate limit
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- id: tweet
uses: ./
env:
CONSUMER_API_KEY: ${{ secrets.CONSUMER_API_KEY }}
CONSUMER_API_SECRET_KEY: ${{ secrets.CONSUMER_API_SECRET_KEY }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
with:
status: |
${{ matrix.os }}
${{ github.sha }}
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- run: test -n "${ID}"
env:
ID: ${{ fromJSON(steps.tweet.outputs.response).id_str }}
# Required status checks
passing:
needs: [ paths, package, test ]
if: always()
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- run: echo "$needs"
env:
needs: ${{ toJSON(needs) }}
- run: exit 1
if: (contains(needs.*.result, 'failure') == false && contains(needs.*.result, 'cancelled') == false) == false # success or skipped