Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add issue url to the files when setting INSERT_ISSUE_URLS: True #252

Open
dharmendrasha opened this issue Dec 5, 2024 · 1 comment

Comments

@dharmendrasha
Copy link

when setting INSERT_ISSUE_URLS: True

name: Create issues from TODOs

on:
  workflow_dispatch:
    inputs:
      MANUAL_COMMIT_REF:
        description: 'The SHA of the commit to get the diff for'
        required: true
      MANUAL_BASE_REF:
        description: 'By default, the commit entered above is compared to the one directly before it; to go back further, enter an earlier SHA here'
        required: false
  pull_request:
  push:
    branches: # TODO: do not set multiple branches, todos might be added and then get referenced by themselves in case of a merge
      - main
#TODO: check works or not
permissions:
  issues: write
  repository-projects: read
  contents: read

jobs:
  todos:
    runs-on: ubuntu-latest

    # TODO: Make sure this work
    steps:
      - uses: actions/[email protected]
        with:
          lfs: true
          fetch-depth: 0

      - name: 'TODO to Issue'
        uses: 'alstr/todo-to-issue-action@v5'
        env:
          MANUAL_COMMIT_REF: ${{ inputs.MANUAL_COMMIT_REF }}
          MANUAL_BASE_REF: ${{ inputs.MANUAL_BASE_REF }}
          INSERT_ISSUE_URLS: True

      - name: Set Git user
        run: |
          git config --global user.name "github-actions[bot]"
          git config --global user.email "github-actions[bot]@users.noreply.github.com"

      - name: Commit and Push Changes
        run: |
          git add -A
          if [[ `git status --porcelain` ]]; then
            git commit -m "Automatically added GitHub issue links to TODOs"
            git push origin main
          else
            echo "No changes to commit"
          fi

there is no changes made when enabling this setting to the file

@alstr
Copy link
Owner

alstr commented Dec 5, 2024

Please can you set the value to a lowercase string: true.

The check works as follows:

os.getenv('INPUT_INSERT_ISSUE_URLS', 'false') == 'true'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants