Coder Social home page Coder Social logo

create-an-issue's Introduction

Create an Issue Action

A GitHub Action that creates a new issue using a template file.

GitHub Actions status Codecov

Usage

This GitHub Action creates a new issue based on an issue template file. Here's an example workflow that creates a new issue any time you push a commit:

# .github/workflows/issue-on-push.yml
on: [push]
name: Create an issue on push
permissions:
  contents: read
  issues: write 
jobs:
  stuff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: JasonEtco/create-an-issue@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This reads from the .github/ISSUE_TEMPLATE.md file. This file should have front matter to help construct the new issue:

---
title: Someone just pushed
assignees: JasonEtco, matchai
labels: bug, enhancement
---
Someone just pushed, oh no! Here's who did it: {{ payload.sender.login }}.

You'll notice that the above example has some {{ mustache }} variables. Your issue templates have access to several things about the event that triggered the action. Besides issue and pullRequest, you have access to all the template variables on this list. You can also use environment variables:

- uses: JasonEtco/create-an-issue@v2
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    ADJECTIVE: great
Environment variables are pretty {{ env.ADJECTIVE }}, right?

Note that you can only assign people matching given conditions.

Dates

Additionally, you can use the date filter and variable to show some information about when this issue was created:

---
title: Weekly Radar {{ date | date('dddd, MMMM Do') }}
---
What's everyone up to this week?

This example will create a new issue with a title like Weekly Radar Saturday, November 10th. You can pass any valid Moment.js formatting string to the filter.

Custom templates

Don't want to use .github/ISSUE_TEMPLATE.md? You can pass an input pointing the action to a different template:

steps:
  - uses: actions/checkout@v3
  - uses: JasonEtco/create-an-issue@v2
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
      filename: .github/some-other-template.md

Inputs

Want to use Action logic to determine who to assign the issue to, to assign a milestone or to update an existing issue with the same title? You can pass an input containing the following options:

steps:
  - uses: actions/checkout@v3
  - uses: JasonEtco/create-an-issue@v2
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
      assignees: JasonEtco, octocat
      milestone: 1
      update_existing: true
      search_existing: all
  • The assignees and milestone speak for themselves.
  • The update_existing param can be passed and set to true when you want to update an open issue with the exact same title when it exists and false if you don't want to create a new issue, but skip updating an existing one.
  • The search_existing param lets you specify whether to search open, closed, or all existing issues for duplicates (default is open).

Outputs

If you need the number or URL of the issue that was created for another Action, you can use the number or url outputs, respectively. For example:

steps:
  - uses: JasonEtco/create-an-issue@v2
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    id: create-issue
  - run: 'echo Created issue number ${{ steps.create-issue.outputs.number }}'
  - run: 'echo Created ${{ steps.create-issue.outputs.url }}'

create-an-issue's People

Contributors

bengry avatar dblock avatar dependabot[bot] avatar jamesmgreene avatar jasonetco avatar lee-dohm avatar nathanielrn avatar parkerbxyz avatar prinsfrank avatar saerosv avatar sunt05 avatar tenhobi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-an-issue's Issues

Fails creating issues.

When using the following settings

  1. The template file located in .github/ISSUE_TEMPLATE.md
---
title: Someone just pushed
assignees: abcdef
labels: bug
---
Someone just pushed, oh no! Here's who did it: {{ payload.sender.login }}.
  1. The action:
- uses: JasonEtco/create-an-issue@v2   
   env:   
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}    

I get this error:

image

/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:32633
		throw jsonErr;
		^
ErrorEXError [JSONError]: Unexpected end of JSON input while parsing near '' in package.json
    at module.exports (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:32628:19)
    at parse (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:18172:29)
    at Function.module.exports.sync (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:18175:29)
    at Function.sync (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:34927:27)
    at Signale.get packageConfiguration [as packageConfiguration] (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:37232:20)
    at new Signale (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:37171:39)
    at Object.528 (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:37143:32)
    at __webpack_require__ (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:38615:43)
    at Object.7045 (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:4902:17)
    at __webpack_require__ (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:38615:43) {
  name: 'JSONError',
  fileName: 'package.json'
}

Allow passing milestone to issue

I want to automatically create an issue once a milestone is created, I have the following workflow:

...
- name: create release-driving issue
  uses: JasonEtco/[email protected]
  with:
    filename: .github/issue_templates/RELEASE_ISSUE_TEMPLATE.md
    assignees: ${{ github.actor }}
    milestone: ${{ github.event.milestone.number }}
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

with RELEASE_ISSUE_TEMPLATE.md having the following content:

---
title: ...
labels: release
milestone: {{ tools.inputs.milestone }}
---

This doesn't work, and I get the following error when running the workflow:

✖ error An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/issue_templates/RELEASE_ISSUE_TEMPLATE.md!
✖ error HttpError: Invalid value for parameter 'milestone': {"[object Object]":null} is NaN

I guess this is because the template is not being passed the milestone input, even though it seems like it should work, following https://github.com/JasonEtco/actions-toolkit#toolsinputs

Output to tell whether the issue was created or updated

I'm currently using this in a scheduled workflow to check NPM advisories against our yarn.lock and file issues when an advisory applies to our dependencies. We'd rely on Dependabot, but that has a file size limit of 0.5MB and our monorepo lockfile is well beyond that.

I use the update_existing option to keep updating the existing issues rather than flooding the repo with new ones. However, I'd like to add the ability to send a Slack message when a new issue is created (but not when one is simply updated). Unfortunately, there's no output from this action that tells my GH Actions job whether the issue was actually created or just updated (or neither).

Would it be possible to get such an output?

Fails to create issue, "can not read a block mapping entry"

https://raw.githubusercontent.com/konstruktoid/ansible-role-hardening/master/.github/ISSUE_TEMPLATE.md:

---
name: Lint failure
about: A lint failure issue
title: [ACTION] Linting failed
labels: bug
---
{{ tools.context.actor }}: {{ tools.context.sha }}
Run JasonEtco/create-an-issue@v2
  with:
    filename: .github/ISSUE_TEMPLATE.md
  env:
    GITHUB_TOKEN: ***
⬤  debug     Reading from file .github/ISSUE_TEMPLATE.md
Error: can not read a block mapping entry; a multiline key may not be an implicit key at line 4, column 7:
    labels: bug
          ^
✖  fatal     YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 4, column 7: 
    labels: bug
          ^
    at generateError (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:15156:10)
    at throwError (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:15162:9)
    at readBlockMapping (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16062:9)
    at composeNode (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16348:12)
    at readDocument (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16514:3)
    at loadDocuments (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16577:5)
    at load (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16603:19)
    at safeLoad (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16626:10)
    at parse (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:12421:20)
    at Object.extractor [as default] (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:12383:12)

Support body and title from action inputs

I'd like to have the action completely contained within the GH workflow instead of requiring a template file. This also makes it easier to refer to GitHub Action context, job, and step outputs.

You're using an old version of issue templates

GitHub tells me that putting templates in .github/ISSUE_TEMPLATE.md and that I should follow https://help.github.com/en/articles/about-issue-and-pull-request-templates to learn how to do it right.

It looks like the recommended way to do this now is to place individual MD files into .github/ISSUE_TEMPLATE directory (not an MD file).

You kind of touch on this in the Custom Templates section of the README but I wonder if the default where this action looks should be .github/ISSUE_TEMPLATES/whatever.md and not .github/ISSUE_TEMPLATE.md. What do you think?

[Remoto] Back-end Developer na [Nuvenga]

01 Desenvolvedor Senior:
01 desenvolvedor Full Time para Node

10+ anos de experiência desenvolvendo
07+ anos de experiência em Node

Remuneração: R$120-140,00/hora
Local de trabalho: Remoto
Início: 21/Junho
Período: 03-12 meses
Full Time
Inglês avançado – precisa se comunicar/falar bem
CNPJ necessário

Interessados, por gentileza enviar Cv, preferencialmente em inglês, para [email protected]

possible to use {{ env.VAR }} in template title?

I'd like to set the title of a new issue using an envar. I tried mimicking the Dates example from the readme by doing the following:

# .github/TEST_FAIL_TEMPLATE.md
---
title: {{ env.TITLE }}
---
...
# action.yml
- name: Report Failures
  if: ${{ failure() }}
  uses: JasonEtco/create-an-issue@v2
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    TITLE: 'Comprehensive tests failing'
  with:
    filename: .github/TEST_FAIL_TEMPLATE.md
    update_existing: true

but I get the following error in github actions

⬤  debug     Reading from file .github/TEST_FAIL_TEMPLATE.md
ℹ  info      Front matter for .github/TEST_FAIL_TEMPLATE.md is { title: { '[object Object]': null }, labels: [ 'bug' ] }
Error: Unexpected template object type undefined; expected 'code', or 'string'
✖  fatal     Error: Unexpected template object type undefined; expected 'code', or 'string' 
    at Template.init (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:26920:17)
    at Template.Obj (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:29905:15)
    at new Template (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:26901:18)
    at Environment.renderString (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:26802:16)
    at createAnIssue (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:38344:20)

thanks in advance for any tips!

Inject env.VAR into code block in issue template?

I have an issue template that has something like

Run `./script.sh {{ env.VERSION }}`

and a github action config like:

- uses: JasonEtco/create-an-issue@v2
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    VERSION: potato

but when running the action, env.VERSION is never replaced? Is it not possible to replace values in backtick/code blocks? The generated issue just has the uninjected "Run ./script.sh {{ env.VERSION }}" instead of "Run ./script.sh potato"

Referenced file contains errors (http://testng.org/testng-1.0.dtd).

The errors below were detected when validating the file "testng-1.0.dtd" via the file "all-tests-api.xml". In most cases these errors can be detected by validating "testng-1.0.dtd" directly. However it is possible that errors will only occur when testng-1.0.dtd is validated in the context of all-tests-api.xml.

image

image

Error logging the issue number

I have some automation in a private repo that uses this Action, so thank you for building it!

Starting seven days ago, my automation is running into a problem where the issue is created but the Action throws an error after that. Relevant log details:

ℹ  info      Creating new issue Completely fake issue title
✖  error     An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/support-news-template.md!
✖  error     TypeError: (s || "").replace is not a function 
    at escapeData (/node_modules/@actions/core/lib/command.js:66:10)
    at Command.toString (/node_modules/@actions/core/lib/command.js:60:35)
    at Object.issueCommand (/node_modules/@actions/core/lib/command.js:23:30)
    at Object.setOutput (/node_modules/@actions/core/lib/core.js:88:15)
    at Toolkit.run (/index.js:49:10)
    at process._tickCallback (internal/process/next_tick.js:68:7)

It took me a while to figure out what was going wrong because I thought that the issue creation was throwing the error but still succeeding somehow? But inside the catch statement you're calling the actions-toolkit logging infrastructure and the stack trace only shows the actions/toolkit code. So it would appear that this line is hitting the error:

core.setOutput('number', issue.data.number)

because it is the first line after the issue is created that calls into core.whatever. I suspect that issue.data.number is no longer returning a Number in all cases?

Let me know if you need more information.

[QUESTION] Why I always have this error ?

It didn't work with .github/ISSUE_TEMPLATE.md

so I tried to move it otherway and change the path to a right one.

##[error]File issues.md could not be found in your project's workspace.

Here is my script. I probably missed a stupid thing but I can't find what...

name: Auto-issuing.js CI

on: [push]
 
jobs:
  auto-create-issue:
    runs-on: ubuntu-latest
    steps:
      - uses: JasonEtco/create-an-issue@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
            filename: issues.md
```

New issue notification

Should GitHub fire a notification upon new issue creation via actions, like it does after a user created an issue?

[Remoto] Back-End Developer na [Nuvenga]

02 desenvolvedores Part Time (20 horas semanais) para Azure

08+ anos de experiência desenvolvendo
05+ anos de experiência em Azure

Conhecimentos necessários: PowerPlatform (PowerBI, PowerApps, PowerAutomate), Azure Functions, PowerShell & MS Teams

Remuneração: R$120-140,00/hora
Local de trabalho: Remoto
Início: Julho 2ªquinzena
Período: 03-06 meses
Inglês avançado – precisa se comunicar/falar bem
CNPJ necessário

Interessados, por gentileza enviar Cv, preferencialmente em inglês, para [email protected]

YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key

Hello @JasonEtco ,

Thanks for your useful Github actions.
However, I'm facing an issue reading the following markdown template:

---
title: {{ env.VULNERABILITY_TOOL }} Security Alert
assignees: {{ tools.context.actor }}
labels: vulnerability, {{ env.VULNERABILITY_TOOL }}
---
{{ date('MMMM Do YYYY, h:mm:ss a') }} - Vulnerabilities were found on when running the tool {{ env.VULNERABILITY_TOOL }} on commit {{ tools.context.sha }}.    

Please, check the Github workflow logs and reports.  
Update this issue and the Pull Request information with the founded vulnerabilities.  

Pipeline triggered by {{ tools.context.actor }}  

I'm getting the following exception:

fatal     YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 2, column 7: 
 at generateError (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:15156:10)
    at throwError (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:15162:9)
    at readBlockMapping (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16062:9)
    at composeNode (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16348:12)
    at readDocument (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16514:3)
    at loadDocuments (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16577:5)
    at load (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16603:19)
    at safeLoad (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16626:10)
    at parse (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:12421:20)
    at Object.extractor [as default] (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:12383:12)

The problem is triggered by assignees and labels.
This try failed on assigneees:

assignees:
  - {{ tools.context.actor }}

When labels failed, I also tried this format:

labels:
  - vulnerability
  - {{ env.VULNERABILITY_TOOL }}

It seems those lists only work with constant strings.

Could you help me, please?

Thanks!

Convert to a JavaScript action

I'd like to convert this to being a JavaScript action, so that users of it don't need to build the Docker container in their workflow - it'd be a little faster ⚡️

However, committing node_modules is a non-starter for me - I think that's an anti-pattern that I'm absolutely going to avoid. Tools like @zeit/ncc are a good enough compromise, so I'll be trying that out (also would mean I can write TypeScript actions without any extra work 😍).

I'd like to investigate/setup a GitHub Actions workflow to do the building and publishing to the specific tags, to avoid having a dist folder in the master branch (again, an anti-pattern). @mheap 👋 has done some awesome work on github-action-auto-compile-node, I'm hoping to just pull that in, potentially also with Actions Tagger.

cc this Twitter thread

Action throws "Toolkit is not a constructor" error

Still wrapping my head around Github actions, so apologies in advance if this is user error. When trying to use this action, I'm getting the following error:

Status: Downloaded newer image for node:10-slim
 ---> e1c896910d82
Step 2/12 : LABEL "com.github.actions.name"="Create an issue"
 ---> Running in 3fa47b3120c8
 ---> 0a7d8fc86e83
Step 3/12 : LABEL "com.github.actions.description"="Creates a new issue using a template with front matter."
 ---> Running in 88720431caa7
 ---> eac404b163b5
Step 4/12 : LABEL "com.github.actions.icon"="alert-circle"
 ---> Running in bed4f0fde0b6
 ---> 2cb61dc4517d
Step 5/12 : LABEL "com.github.actions.color"="gray-dark"
 ---> Running in b361774ba9b1
 ---> 5236b7451418
Step 6/12 : LABEL "repository"="http://github.com/JasonEtco/create-an-issue"
 ---> Running in faf0adddb697
 ---> f364d3933005
Step 7/12 : LABEL "homepage"="http://github.com/JasonEtco/create-an-issue"
 ---> Running in d08a45c4f1b8
 ---> 702801b35e06
Step 8/12 : LABEL "maintainer"="Jason Etcovitch <[email protected]>"
 ---> Running in 25475790fdd7
 ---> 974772ec027f
Step 9/12 : COPY package*.json ./
 ---> 5b03db0f5400
Step 10/12 : RUN npm ci
 ---> Running in 516e67cfd5c1

> [email protected] install /node_modules/fsevents
> node install


> [email protected] postinstall /node_modules/nunjucks
> node postinstall-build.js src

added 735 packages in 13.565s
 ---> 6d58ed293080
Step 11/12 : COPY . .
 ---> d889be475787
Step 12/12 : ENTRYPOINT ["node", "/entrypoint.js"]
 ---> Running in 97a7f081f348
 ---> 9c5d8ea6e76a
Successfully built 9c5d8ea6e76a
Successfully tagged gcr.io/gct-12-kgx7e8rl4ef9xwnau6ctqt7/40b8fc6da7f452838798bd45f95fdff2e9aa51b30996936439499c96046de748/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1:7716aec47b53ff745f3814b6f31e8981c0d85d58806b539ffdf2a419add25985
Already have image (with digest): gcr.io/github-actions-images/action-runner:latest
/entrypoint.js:4
const tools = new Toolkit()
              ^

TypeError: Toolkit is not a constructor
    at Object.<anonymous> (/entrypoint.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

### FAILED Create an issue 22:23:21Z (47.086s)

use env variables

Great to know this action!
In addition to the several internal template variables, would it be possible to use env variables as well?

iOS 13.3 is not compatible with xcode 11.3

Hi,

I tried installing an application on iOS device having 13.3 iOS version through appium server
, but it is giving error iOS 13.3 is not compatible with xcode 11.3. can anyone pls help. when I checked support for iOS 13.3, it is saying to be compatible with xcode 11.3 .

could anyone pls help.

Help: how we can send another repo string

Checking the script, I see that ...tools.context.repo uses the current repository. But it can be good to receive another repositories string.

Have a parameter spec to send, or I can create a PR for improving it?

Fusing PET and MRI images

Hi,
I am working on PET/MR Images, and I need to fuse every pair of PET/MR image of all single subjects. I searched the GitHub but didn't find any proper code, most of them are just combining 2D images in JPEG or PNG formats, while my images are 3D. If some one could help me with this, I would appreciate it.
Thank you in advance

bug: spread omits class getters

I've written a quick demo of the issue in The Typescript playground.

Here's the code included inline:

class Context {
    public prop = 'prop';

    public get getter() {
        return 'getter';
    }
}

const context = new Context();
console.log({...context});

This prints:

{ prop: 'prop' }

I noticed this issue while trying to write a Github workflow that creates an issue that references a pull request, i.e., accessing context.pullRequest inside the issue template, which continually renders as an empty string.

In the meantime, I'm able to get that data via {{ payload.pull_request.number }} (mirror the logic in the getter).

pull access denied for c27d31

Hello,
docker pull denied when Github Actions run on public repo, would be need to try docker login?

Github Actions log

2020-05-09T13:44:02.9220163Z ##[group]Run JasonEtco/create-an-issue@v2
2020-05-09T13:44:02.9220371Z with:
2020-05-09T13:44:02.9220533Z   filename: .github/ISSUE_TEMPLATE/minikube-ci-failure.md
2020-05-09T13:44:02.9220691Z env:
2020-05-09T13:44:02.9220840Z   MINIKUBE_HOME: /home/runner
2020-05-09T13:44:02.9221882Z   GITHUB_TOKEN: ***
2020-05-09T13:44:02.9222051Z ##[endgroup]
2020-05-09T13:44:02.9251364Z ##[command]/usr/bin/docker run --name c27d312d8b37f6648a44e490f21b062b222339_a2bc56 --label c27d31 --workdir /github/workspace --rm -e MINIKUBE_HOME -e GITHUB_TOKEN -e INPUT_FILENAME -e INPUT_ASSIGNEES -e INPUT_MILESTONE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/k8s-3tier-webapp/k8s-3tier-webapp":"/github/workspace" c27d31:2d8b37f6648a44e490f21b062b222339
2020-05-09T13:44:03.7687282Z Unable to find image 'c27d31:2d8b37f6648a44e490f21b062b222339' locally
2020-05-09T13:44:03.8896921Z /usr/bin/docker: Error response from daemon: pull access denied for c27d31, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
2020-05-09T13:44:03.8897386Z See '/usr/bin/docker run --help'.

Github Action Path

https://github.com/yurake/k8s-3tier-webapp/actions/runs/99973885

issue template frontmatter: can not read a block mapping entry (assignees)

.github/workflows/ci.yml

    - name: HandleIfFailure
      if: failure()
      uses: JasonEtco/create-an-issue@v2
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        filename: .github/issue-on-failure.md

ISSUE.md contains the frontmatter (taken from examle on the README): https://github.com/JasonEtco/create-an-issue#usage

---
title: {{ action }} Failed
assignees: meowsbits, belfordz, shanejonas, chunfuyang, tzdybal
labels: bug
---
Run JasonEtco/create-an-issue@v2
/usr/bin/docker run --name e87b52c88190669f0e4c348eaa15216b31645b_20d9c1 --label e87b52 --workdir /github/workspace --rm -e ETH_DNS_DISCV4_CRAWLTIME -e ETH_DNS_DISCV4_PARENT_DOMAIN -e ETH_DNS_DISCV4_KEY_PATH -e ETH_DNS_DISCV4_KEYPASS_PATH -e CLOUDFLARE_API_TOKEN -e ETH_DNS_CLOUDFLARE_ZONEID -e ETH_DNS_DISCV4_KEY -e ETH_DNS_DISCV4_KEYPASS -e GOROOT -e GITHUB_TOKEN -e INPUT_FILENAME -e INPUT_ASSIGNEES -e INPUT_MILESTONE -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/discv4-dns-lists/discv4-dns-lists":"/github/workspace" e87b52:c88190669f0e4c348eaa15216b31645b
⬤  debug     Reading from file .github/issue-on-failure.md
##[error]can not read a block mapping entry; a multiline key may not be an implicit key at line 2, column 10:
    assignees: meowsbits, belfordz, shanejona ... 
             ^
✖  fatal     YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 2, column 10: 
    assignees: meowsbits, belfordz, shanejona ... 
             ^
    at generateError (/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
    at throwError (/node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
    at readBlockMapping (/node_modules/js-yaml/lib/js-yaml/loader.js:1073:9)
    at composeNode (/node_modules/js-yaml/lib/js-yaml/loader.js:1359:12)
    at readDocument (/node_modules/js-yaml/lib/js-yaml/loader.js:1519:3)
    at loadDocuments (/node_modules/js-yaml/lib/js-yaml/loader.js:1575:5)
    at Object.load (/node_modules/js-yaml/lib/js-yaml/loader.js:1596:19)
    at parse (/node_modules/front-matter/index.js:61:27)
    at extractor (/node_modules/front-matter/index.js:24:12)
    at Toolkit.run (/index.js:28:32)

HttpError: Validation Failed

Hi,

when adding multiple assignees, or 1 assignee that is not me, this error occurs:

image

Any idea how to fix that?

I have this workflow

name: docs

on:
  pull_request:
    types:
    - closed
    paths:
    - 'README.md'
    - 'docs/*'

jobs:
  # Create an issue, if any changes to source docs were made.
  create-issue:
    runs-on: ubuntu-latest
    if: github.event.pull_request.merged == true

    steps:
      - uses: actions/checkout@v2

      - uses: JasonEtco/create-an-issue@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          filename: .github/DOCS_ISSUE_TEMPLATE.md

and this template:

---
title: "[Translations] Include changes from #{{ payload.pull_request.number }}"
assignees: felangel
labels: documentation, translation
---
Update Translations to include #{{ payload.pull_request.number }}

- [ ] en (@felangel)
- [ ] cs (@tenhobi)

Available template variables.

Hi,
according to the README we can set different variables, e.g. Someone just pushed, oh no! Here's who did it: {{ payload.sender.login }}., and the list of available template variables is present at https://github.com/JasonEtco/actions-toolkit#toolscontext.

However, payload.* isn't anywhere to be found on https://github.com/JasonEtco/actions-toolkit and when using {{ tools.context.actor }}: {{ tools.context.sha }} no information is added to the created issue.

See konstruktoid/ansible-role-hardening#48 and https://github.com/konstruktoid/ansible-role-hardening/runs/1965196550?check_suite_focus=true#step:4:1

Open issue based on issue comment

👋 Hi @JasonEtco! I'm looking for an action to open an issue based on a template when there's an issue comment. Ex: We're done with some phase of a project, and we'd like to comment /open-issue PHASE PROJECT-NAME and have an issue be created from a template, with the project name, and also ideally linking back to the issue where the comment was created.

Is this action tweak-able to do that? Or, would we need to create a new action to accomplish that?

Assignees and labels shouldn't be an array

👋I want to start off by saying thank you for writing this action 💖 It's super helpful!

BUT, I found a bug when it comes to adding assignees and labels. Although the frontmatter section of issue templates appears to want a real yaml format, listing the assignees and labels as an array instead of a csv string breaks the template and doesn't automatically add the assignees and labels. Also, when you use the "setup templates" wizard from the settings page in the repo, it will generate a file with csv strings, so I had to modify my template to work with this action

- labels: standup
- assignees: bswinnerton, janester, nronas
+ labels: 
+  - standup
+ assignees: 
+  - bswinnerton
+  - janester
+  - nronas

when my action ran with the old csv format, I got this error

For 'properties/assignees', "bswinnerton, janester, nronas" is not an array.
For 'properties/labels', "standup" is not an array.

and then I checked your tests and saw that you are expecting yaml arrays

https://github.com/JasonEtco/create-an-issue/blob/57549108a54d43505e2f3b533685e53ed6f19300/tests/fixtures/.github/kitchen-sink.md

But I think this can be easily fixed by just doing a .split(",") here

create-an-issue/index.js

Lines 36 to 37 in 5754910

assignees: attributes.assignees || [],
labels: attributes.labels || [],

and updating the tests to expect csv strings

cc @JasonEtco

Unable to call `date`, which is not a function

When using date on a template, it throws the following error:

 Error: Unable to call `date`, which is not a function
✖  fatal     Template render error: (unknown path) 
  Error: Unable to call `date`, which is not a function
    at Object._prettifyError (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:28831:11)
    at /home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:26986:19
    at Template.root [as rootRenderFunc] (eval at _compile (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:27056:18), <anonymous>:25:3)
    at Template.render (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:26975:10)
    at Environment.renderString (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:26803:17)
    at createAnIssue (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:38343:19)

[Remoto] Front-End Developer na [Nuvenga]

02 Desenvolvedores Senior:
01 desenvolvedor Full Time para Android
01 desenvolvedor Full Time para React

10+ anos de experiência desenvolvendo
07+ anos de experiência na linguagem que for aplicar

Remuneração: R$120-140,00/hora
Local de trabalho: Remoto
Início: 21/Junho
Período: 03-12 meses
Full Time
Inglês avançado – precisa se comunicar/falar bem
CNPJ necessário

Interessados, por gentileza enviar Cv, preferencialmente em inglês, para [email protected]

This might be caused by a malformed issue title, or a typo in the labels or assignees.

  • I am getting below error and I have tried many changes in the template file, used default one but getting this error every time.

image

  • It also says bad credentials, can it be because of token that I am using is missing some required permissions?

  • Example Issue template that I used:

---
title: Someone just pushed
assignees: 1uc1f3r616
labels: bug
---
Someone just pushed, oh no! Here's who did it: {{ payload.sender.login }}.
  • Actions template
on: [pull_request]
name: dependabot bot issue
jobs:
  stuff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: JasonEtco/create-an-issue@v2
        env:
          GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
        with:
          filename: .github/dependabot.md

How to use custom date variable?

I want to use custom date in issue template.

ex) when create future routine works issue

Looking at the read.me, it seems that you can't change anything other than the format.If you have any means, please let me know.

using payload vars in assignee

Hi,
I using {{ payload.sender.login }} in assigneed template, it fails
Works fine with "hard coded" user id.

Example template:

---
title: test
assignees: {{ payload.sender.login }}
labels: bug, enhancement
---
Someone just pushed: {{ payload.sender.login }}

frontmatter header is not parsed. Adding quotes does not help.
Would be nice to get away to assign issue from input vars

Action log:

debug     Reading from file .github/create_account.md
info      Front matter for .github/create_account.md is { title: 'NEw push, new task...',
  assignees: { '[object Object]': null },
  labels: 'bug, enhancement' }
 debug     Templates compiled { body: 'Someone just pushed, oh no! Here\'s who did it: XXX\n',
  title: 'NEw push, new task...' }
 info      Creating new issue NEw push, new task...
 error     An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/create_account.md!
 error     TypeError: list.split is not a function 
    at listToArray (/index.js:8:44)
    at Toolkit.run (/index.js:42:18)
    at Function.<anonymous> (/node_modules/actions-toolkit/lib/index.js:107:31)
    at step (/node_modules/actions-toolkit/lib/index.js:43:23)
    at Object.next (/node_modules/actions-toolkit/lib/index.js:24:53)
    at /node_modules/actions-toolkit/lib/index.js:18:71
    at new Promise (<anonymous>)
    at __awaiter (/node_modules/actions-toolkit/lib/index.js:14:12)
    at Function.Toolkit.run (/node_modules/actions-toolkit/lib/index.js:98:16)
    at Object.<anonymous> (/index.js:11:9)

date variable parsing?

Hey Jason,

thanks for your contribution! :) One question: Do I do anything wrong regarding the date variable? Seems like it can't be resolved in my case.

maxstreifeneder/actionstests#1
https://github.com/maxstreifeneder/actionstests/blob/main/.github/ISSUE_TEMPLATE/teammeeting.md
https://github.com/maxstreifeneder/actionstests/blob/main/.github/workflows/teammeeting.yml

variable names are appearing in the issue title as they are in the template and don't get parsed, unfortunately.

Thanks in advance and cheers,
Max

Thank you!

No issues, no questions, just letting you know that you have done an amazing job.

❤️

Atom - saved file data dumped!

I am coding a basic html/css site, saving with ctr+s and viewing on chrome. There were a few crashes yesterday, but the files reopened to the last saved point.

This morning, when I opened Atom, ALL DATA saved yesterday for both the css and html files were completely gone. The files were there, and the data from the day previous was there, but all of the progress yesterday was completely gone. How?? What gives??? How can I prevent this in the future???

STEPS:

  1. Atom is up-to-date 1.58.0 x64
  2. Open html file in Atom
  3. Open css file in different Atom window
  4. Open html in Chrome > inspect
  5. Hit ctrl+s a million of times while viewing in Chrome
  6. Atom crashes after a couple hours 🙄
  7. Reopen files in Atom, saved data is there
  8. Atom crashes again a couple hours later 🙄
  9. Reopen files again in Atom, saved data is there
  10. Atom crashes one more time at the end of the night, I close my Mac and call it a day.
  11. Restart Mac in the morning because internet is too slow
  12. Open html and css file in Atom
  13. Open html in Chrome...and BOOM realised that saved data was gone.😱
  14. Searched computer for a temp file, but NG 😭😭😭
  15. Report Issue on Github in desperation.😢

Thank you very much for any guidance on understanding what happened and how to prevent something like this in the future! 🙏🏻🙏🏻🙏🏻

Malformed label error for labels including a colon

We use labels might include a colon such as module: datasets. The label section of the issue template looks like this:

labels: 
    - bug
    - "module: datasets"

Trying to open an issue with this template fails (see https://github.com/pytorch/vision/actions/runs/271212579 for an example):

⬤  debug     Reading from file .github/failed_schedule_issue_template.md
ℹ  info      Front matter for .github/failed_schedule_issue_template.md is { title: 'Scheduled workflow {{ env.WORKFLOW }}/{{ env.JOB }} failed',
  labels: [ 'bug', 'module: datasets' ] }
⬤  debug     Templates compiled { body:
   'Oh no, something went wrong in the scheduled workflow tests/download. \nPlease look into it:\n\nhttps://github.com/pytorch/vision/actions/runs/271212579\n\nFeel free to close this if this was just a one-off error.\n',
  title: 'Scheduled workflow tests/download failed' }
ℹ  info      Creating new issue Scheduled workflow tests/download failed
✖  error     An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/failed_schedule_issue_template.md!
✖  error     HttpError: Resource not accessible by integration 
    at response.text.then.message (/node_modules/@octokit/request/dist-node/index.js:66:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/failed_schedule_issue_template.md!

It seems that label is correctly recognized as string. Thus, I assume some internal parsing is causing this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.