Skip to content

chore(ci): automatically handle dist folder in PRs and releases #905

chore(ci): automatically handle dist folder in PRs and releases

chore(ci): automatically handle dist folder in PRs and releases #905

Workflow file for this run

name: PR
on:
pull_request:
merge_group:
jobs:
test:
name: Test Action
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
add_markdown: |
---
# Things!
## Excitement!
[Links!](https://google.ca)
`Code!`
- uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
limit_to_pr_opened: true
add_markdown: |
---
# Things!
## Excitement!
[Links!](https://google.ca)
`Code!`
dist:
name: Check dist/
if: github.event_name == 'merge_group'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# For push, later
ref: ${{ github.head_ref }}
- uses: actions/[email protected]
with:
node-version: 20.x
- name: Rebuild the dist/ directory
run: |
npm ci
npm run build
npm run package
# - name: Commit any changes to dist/
# run: |
# if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
# git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# git config --global user.name "${GITHUB_ACTOR}"
# git add .
# git commit -m "Rebuild dist/ directory"
# git push origin HEAD:${{ github.head_ref }}
# fi
- uses: EndBug/add-and-commit@v9
with:
add: 'dist/'
message: Show GitHub Actions logo
committer_name: GitHub Actions
committer_email: [email protected]
- name: Purposeful fail
run: exit 1
results:
name: PR Results
needs: [test, dist]
if: always()
runs-on: ubuntu-22.04
steps:
- if: contains(needs.*.result, 'failure')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"
dump:
name: Dump context
runs-on: ubuntu-latest
env:
CONTEXT: ${{ toJson(github) }}
steps:
- run: echo "${CONTEXT}"