Update input names

This commit is contained in:
alstr 2022-10-27 10:10:19 +01:00
parent 223e23516d
commit eb4306a705
2 changed files with 16 additions and 16 deletions

View File

@ -3,11 +3,11 @@ on:
push:
workflow_dispatch:
inputs:
BASE_MANUAL:
description: "The base SHA"
MANUAL_COMMIT_REF:
description: "The SHA of the commit to get the diff for"
required: true
HEAD_MANUAL:
description: "The head SHA"
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
jobs:
build:
@ -18,9 +18,9 @@ jobs:
uses: "alstr/todo-to-issue-action@master"
id: "todo"
env:
BASE_MANUAL:
${{ inputs.BASE_MANUAL }}
HEAD_MANUAL:
${{ inputs.HEAD_MANUAL }}
MANUAL_COMMIT_REF:
${{ inputs.MANUAL_COMMIT_REF }}
MANUAL_BASE_REF:
${{ inputs.MANUAL_BASE_REF }}
with:
PROJECTS_SECRET: ${{ secrets.PROJECTS_SECRET }}

16
main.py
View File

@ -646,14 +646,14 @@ class TodoParser(object):
if __name__ == "__main__":
# Create a basic client for communicating with GitHub, automatically initialised with environment variables.
client = GitHubClient()
base_manual = os.getenv('BASE_MANUAL')
head_manual = os.getenv('HEAD_MANUAL')
if base_manual and head_manual:
print(f'Manually comparing {base_manual}...{head_manual}')
client.diff_url = f'{client.repos_url}{client.repo}/compare/{base_manual}...{head_manual}'
elif base_manual:
print(f'Manual checking {base_manual}')
client.diff_url = f'{client.repos_url}{client.repo}/commits/{base_manual}'
manual_commit_ref = os.getenv('MANUAL_COMMIT_REF')
manual_base_ref = os.getenv('MANUAL_BASE_REF')
if manual_commit_ref and manual_base_ref:
print(f'Manually comparing {manual_base_ref}...{manual_commit_ref}')
client.diff_url = f'{client.repos_url}{client.repo}/compare/{manual_base_ref}...{manual_commit_ref}'
elif manual_commit_ref:
print(f'Manual checking {manual_commit_ref}')
client.diff_url = f'{client.repos_url}{client.repo}/commits/{manual_commit_ref}'
if client.diff_url or len(client.commits) != 0:
# Get the diff from the last pushed commit.
last_diff = StringIO(client.get_last_diff())