Skip to content

Commit

Permalink
Merge pull request #150 from rerost/rerost/add-template-issue-url-for…
Browse files Browse the repository at this point in the history
…-actions

Add template-issue-url
  • Loading branch information
rerost authored Aug 29, 2024
2 parents fc86df8 + 9f074ed commit df7ce39
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
# https://github.com/rerost/issue-creator-for-test/issues/102 を元にissueを作るテスト
run: |
docker build -t test .
docker run test rerost/issue-creator-for-test 102 true "echo 'OK'" $TEST_TOKEN false
docker run test '' rerost/issue-creator-for-test 102 true "echo 'OK'" $TEST_TOKEN false
docker run test https://github.com/rerost/issue-creator-for-test/issues/102 '' '' true "echo 'OK'" $TEST_TOKEN false
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
docker_build_and_push:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/manual_url.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Check actions work for url"
on: workflow_dispatch

jobs:
create-issue:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
template-issue-url: https://github.com/rerost/issue-creator/issues/1
close-last-issue: true
25 changes: 14 additions & 11 deletions action.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/bin/sh

repository=$1
template_issue=$2
close_last_issue=$3
check_before_create_issue=$4
token=$5
is_discussion=$6
url=$1
close_last_issue=$4
token=$6
if [ -z $url ]; then
repository=$2
template_issue=$3
check_before_create_issue=$5
is_discussion=$7

type="issues"
type="issues"

if [ "${is_discussion}" = "true" ]; then
type="discussions"
fi
if [ "${is_discussion}" = "true" ]; then
type="discussions"
fi

url=https://github.com/${repository}/${type}/${template_issue}
url=https://github.com/${repository}/${type}/${template_issue}
fi
echo ${url}

/issue-creator \
Expand Down
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ description: 'Periodically create GitHub issue'
inputs:
template-issue:
description: 'Specify the issue number of the template in the repository. e.g. 1'
required: true
default: ""
required: false
template-issue-url:
description: 'Specify the issue url of the template. e.g. https://github.com/rerost/issue-creator/issues/1'
default: ""
required: false
close-last-issue:
description: 'If true, issue-creator closes the previous issue.'
default: true
Expand All @@ -22,6 +27,7 @@ runs:
using: "docker"
image: 'Dockerfile.actions'
args:
- ${{ inputs.template-issue-url }}
- ${{ inputs.repository }}
- ${{ inputs.template-issue }}
- ${{ inputs.close-last-issue }}
Expand Down

0 comments on commit df7ce39

Please sign in to comment.