mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2025-12-15 12:46:30 +00:00
`yarn all` doesn't necessarily add a newline at the end. The env reader expects the EOF string to be on its own line, so if the yarn command does not produce this, the workflow fails.
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Test
|
|
on:
|
|
pull_request_target:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: yarn install
|
|
- run: |
|
|
set -o pipefail
|
|
mkdir -p ./pr
|
|
echo ${{ github.event.number }} | tee ./pr/number
|
|
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
|
|
echo "all_result<<$EOF" >> "$GITHUB_ENV"
|
|
yarn all >> "$GITHUB_ENV"
|
|
echo >> "$GITHUB_ENV" # yarn all doesn't necessarily produce a newline
|
|
echo "$EOF" >> "$GITHUB_ENV"
|
|
id: all
|
|
- uses: ./
|
|
if: ${{ github.event_name == 'pull_request_target' }}
|
|
with:
|
|
header: All
|
|
message: |
|
|
<details open>
|
|
<summary>output of yarn all</summary>
|
|
|
|
```
|
|
${{ env.all_result }}
|
|
```
|
|
</details>
|
|
- uses: ./
|
|
if: ${{ github.event_name == 'pull_request_target' }}
|
|
with:
|
|
header: All
|
|
append: true
|
|
hide_details: true
|
|
message: |
|
|
The build is over.
|