Fix #9171: add expand-records preprocessing to enable constant folding #254
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Mark Pull Requests Ready for Review | |
| on: | |
| pull_request: | |
| types: [opened] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| permissions: {} | |
| jobs: | |
| mark-ready: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Mark all draft pull requests ready for review | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | |
| script: | | |
| async function markReady(nodeId, number, title) { | |
| core.info(`Marking PR #${number} "${title}" ready for review.`); | |
| try { | |
| await github.graphql(` | |
| mutation($id: ID!) { | |
| markPullRequestReadyForReview(input: { pullRequestId: $id }) { | |
| pullRequest { number isDraft } | |
| } | |
| } | |
| `, { id: nodeId }); | |
| } catch (err) { | |
| core.warning(`Failed to mark PR #${number} ready for review: ${err.message}`); | |
| } | |
| } | |
| if (context.eventName === 'pull_request') { | |
| const pr = context.payload.pull_request; | |
| if (pr.draft) { | |
| await markReady(pr.node_id, pr.number, pr.title); | |
| } else { | |
| core.info(`PR #${pr.number} is already ready for review. Nothing to do.`); | |
| } | |
| } else { | |
| const pulls = await github.paginate(github.rest.pulls.list, { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| }); | |
| const drafts = pulls.filter(pr => pr.draft); | |
| core.info(`Found ${drafts.length} draft pull request(s).`); | |
| for (const pr of drafts) { | |
| await markReady(pr.node_id, pr.number, pr.title); | |
| } | |
| } | |
| core.info('Done.'); |