googleapis / googleapis/release-please-action

Provide output of the PR that was released when creating releases

Open
#776 1 comment 0 reactions 0 assignees View on GitHub
type: feature request
Dominant language
TypeScript
Stars
2.5k
Forks
327
PR merge metrics
No merged PRs in 30d

Description

### TL;DR

When publishing a release with `command` left on the default value, the `prs` output is empty.

### Expected behavior

The `prs` value should be set, and should contain all the PRs that were affected by the release.

### Observed behavior

The `prs` output is empty

### Action YAML

```yaml
on:
push:
branches:
- main

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
prs: ${{ steps.release.outputs.prs }}
steps:
- id: release
uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: page-reducer
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
prerelease: true
release-as: "0.0.1"

npm-publish:
runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.release_created
environment: npm
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

tag-published:
runs-on: ubuntu-latest
needs: npm-publish
permissions:
pull-requests: write
if: needs.npm-publish.result
steps:
- uses: actions/github-script@v6
with:
script: |
const prs = JSON.parse("${{ needs.release-please.outputs.prs }}")
for (const pr of prs) {
github.rest.issues.addLabels({
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["autorelease: published"]
})
}
```

### Log output

```text
Run: https://github.com/thislooksfun/page-reducer/actions/runs/5106996303
```

### Additional information

I want the `prs` output to be set so I can add the `autorelease: published` tag to all the PRs that were published after a successful run.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.