question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Missing either 'issue-number' or 'comment-id'.

See original GitHub issue

Hi I’m trying to use this step to add comments on both new PR and PR that already exists. Right now this part github workflow looks like this: `name: deploy swagger specs

on: push: paths: - ‘swagger-/**.yaml’

jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 … - name: Deploy run: aws s3 sync … - name: Create comment uses: peter-evans/create-or-update-comment@v1 with: issue-number: ${{ github.event.pull_request.number }} body: | Swagger specs were deployed to https://swagger.example.com/${GITHUB_REF##*/}/example.yaml`

But this workflow fails on Create comment step, with such error: Run peter-evans/create-or-update-comment@v1 Error: Missing either 'issue-number' or 'comment-id'. I don’t know how to troubleshoot this further. I already tried to use github.event.issue.number and github.event.number instead of github.event.pull_request.number but error never changed. Any idea what am I doing wrong? thanks.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
agorkiycommented, Mar 8, 2022

Ended up using this: - name: Extract branch name shell: bash run: echo “##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF})” id: extract_branch And then used ${{ steps.extract_branch.outputs.branch }} as variable. Thank you for your help.

0reactions
Norfeldtcommented, May 30, 2022

Just gonna share what worked for me:

ci.pr.yml

name: CI

on: 
  pull_request:
    types: [opened]

jobs:
  todo-fixme-comment:
    runs-on: ubuntu-latest
    steps:
      - name: checkout repository
        uses: actions/checkout@v3
      - name: get yarn cache directory path
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - name: Setup cache key and directory for node_modules cache
        uses: actions/cache@v3
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
      - name: yarn
        run: yarn --frozen-lockfile
      - id: find-pull-request
        uses: jwalton/gh-find-current-pr@v1
        with:
          # Can be "open", "closed", or "all".  Defaults to "open".
          state: open
      - name: create TODO/FIXME comment body
        id: comment-body
        run: |
          yarn todos --exit-nicely --reporter markdown > TODO.md
          body="$(sed 1,2d TODO.md)"
          body="${body//'%'/'%25'}"
          body="${body//$'\n'/'%0A'}"
          body="${body//$'\r'/'%0D'}" 
          echo "::set-output name=body::$body"
      - name: post TODO/FIXME comment to PR
        uses: peter-evans/create-or-update-comment@v2
        with:
          issue-number: ${{ steps.find-pull-request.outputs.number }}
          body: ${{ steps.comment-body.outputs.body }}   

This job pust all the code comments with // TODO // FIXME as a comment on every PR opening.

then the other jobs that runs on push goes into ci.push.yml

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create or Update Comment · Actions · GitHub Marketplace
A GitHub action to create or update an issue or pull request comment. This action was created to help facilitate a GitHub Actions...
Read more >
Commenting a pull request in a GitHub action - Stack Overflow
In a run triggered by pull_request , GITHUB_TOKEN doesn't have write access to the repository and causes the error 'Resource not accessible by ......
Read more >
CHANGELOG.md - go-gitea/gitea - Sourcegraph
Changelog. This changelog goes through all the changes that have been made in each release without substantial changes to our git log; to...
Read more >
Use GitHub Actions to deploy GatsbyJS to Netlify
To avoid build error in Netlify deploys, I migrate the CD from Netlify to ... uses: peter-evans/find-comment@v1 id: fc with: issue-number: ...
Read more >
Markup comments | Bitbucket Cloud - Atlassian Support
When you create a reference, saving the comment or issue causes Bitbucket to automatically link to that object. ... Syntax : issue #number....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found