Git Product home page Git Product logo

gajira-login's Introduction


⚠️ This repository isn’t maintained anymore.

Jira Login

Used to store credentials for later use by other Jira Actions

Only supports Jira Cloud. Does not support Jira Server (hosted)

This is required by other actions like:

  • Transition - Transition a Jira issue
  • Comment - Add a comment to a Jira issue
  • Create - Create a new Jira issue
  • Find issue key - Search for an issue key in commit message, branch name, etc. This issue key is then saved and used by the next actions in the same workflow
  • TODO - Create a Jira issue for each TODO comment in committed code
  • CLI - Wrapped go-jira CLI for common Jira actions

Usage

An example workflow to create a Jira issue for each //TODO in code:

on: push

name: Jira Example

jobs:
  build:
    runs-on: ubuntu-latest
    name: Jira Example
    steps:
    - name: Login
      uses: atlassian/gajira-login@v3
      env:
        JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
        JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
        JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

    - name: Jira TODO
      uses: atlassian/gajira-todo@v3
      with:
        project: GA
        issuetype: Task
        description: Created automatically via GitHub Actions
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

More examples at gajira repository


Action Spec:

Enviroment variables

  • JIRA_BASE_URL - URL of Jira instance. Example: https://<yourdomain>.atlassian.net
  • JIRA_API_TOKEN - Access Token for Authorization. Example: HXe8DGg1iJd2AopzyxkFB7F2 (How To)
  • JIRA_USER_EMAIL - email of the user for which Access Token was created for . Example: [email protected]

Arguments

  • None

Writes fields to config file at $HOME/jira/config.yml

  • email - user email
  • token - api token
  • baseUrl - URL for Jira instance

Writes fields to CLI config file at $HOME/.jira.d/config.yml

  • endpoint - URL for Jira instance
  • login - user email

Writes env to file at $HOME/.jira.d/credentials

  • JIRA_API_TOKEN - Jira API token to use with CLI

gajira-login's People

Contributors

drudzikatlassian avatar joshkay10 avatar mboudreau avatar paulschuberth avatar rudzon avatar swinton 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

Watchers

 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

gajira-login's Issues

gajira-login returns `Jira API error`

I currently set a gh-action on my repo as instructed here.

The action returns a 401 http response with a body message Basic authentication with passwords is deprecated (...).
Am I doing something wrong here or the gh-action should be updated to a new login method?

Jira Login returns Logged in as undefined

Screen Shot 2020-08-04 at 8 39 50 PM

As you see above image, Logged in as: undefined and next step(Jira Transition) wasn't executed.
I think I set the correct JIRA_BASE_URL, JIRA_USER_EMAIL, and JIRA_API_TOKEN.
Is there any way to find why it's failing?

This is from log file

2020-08-05T03:04:51.7766145Z ##[group]Run atlassian/gajira-login@master
2020-08-05T03:04:51.7766344Z env:
2020-08-05T03:04:51.7766514Z   JAVA_HOME_8.0.265_x64: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-08-05T03:04:51.7766693Z   JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-08-05T03:04:51.7766870Z   JAVA_HOME_8_0_265_X64: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-08-05T03:04:51.7767629Z   JIRA_BASE_URL: ***
2020-08-05T03:04:51.7767841Z   JIRA_USER_EMAIL: ***
2020-08-05T03:04:51.7768011Z   JIRA_API_TOKEN: ***
2020-08-05T03:04:51.7768163Z ##[endgroup]
2020-08-05T03:04:52.0987644Z Logged in as: undefined

Syntax Error: Unexpected token .

When I try to run this in a workflow I receive a syntax error. Please note that I'm only able to read the error using Act.

Error

/run/act/actions/atlassian-gajira-login@master/dist/index.js:21407
    if (tag?.format)
            ^
SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:720:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
    at internal/main/run_main_module.js:17:11

Job

jobs:
  update-jira:
    name: Update JIRA ticket
    runs-on: ubuntu-latest
    steps:
      - name: Login
        uses: atlassian/gajira-login@master
        env:
          JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
          JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
          JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

Login fail after upgrade to v3.0.0 (please specify JIRA_BAS_URL)

Run atlassian/gajira-login@v3
Error: Please specify JIRA_BASE_URL env
at exec (/home/runner/work/_actions/atlassian/gajira-login/v3/dist/index.js:29722:43)
at /home/runner/work/_actions/atlassian/gajira-login/v3/dist/index.js:29769:1
at /home/runner/work/_actions/atlassian/gajira-login/v3/dist/index.js:29771:3
at Object. (/home/runner/work/_actions/atlassian/gajira-login/v3/dist/index.js:29774:12)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47

Same yaml conf works in another action (it waa working when using v2)

steps:
  - name: Jira Login
    uses: atlassian/gajira-login@v3 # same with v3.0.0
    env:
      JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
      JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
      JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

Login job fails with 401 Unauthorized error.

Hey guys.
I've added all three params in ci workflow:
JIRA_BASE_URL: https://p2pvalidator.atlassian.net
JIRA_USER_EMAIL: $JIRA_USER_EMAIL
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

but it fails with 401.

I checked with postman - it works, the JIRA_API_TOKEN is valid.

According to this job, there are headers null. looks like my api token is not setting. Can you help me please?

https://github.com/p2p-org/key-app-android/actions/runs/3956087771/jobs/6774957106

Node 16 end of life

Node 16 is end of life, and GitHub actions are transitioning all actions to Node 20.

See more:

GitHub Actions: Transitioning from Node 16 to Node 20

GitHub actions currently generate a warning when using the latest (v3) version of atlassian/gajira-login

Example warning:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: atlassian/gajira-login@v3, atlassian/gajira-cli@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Not working behind proxy

When trying to run the github action behind a proxy it does not use it and instead goes out the firewall. This is despite setting the proxy env vars in the actions step prior which works for every other action step we've used to date. Could we get a code change to allow this action step as well as the rest of the jira actions steps just to use the proxy if proxy setting are set in env vars?

Error:
Error: Jira API error
at Jira.fetch (/var/lib/ghactions/actions-runner/_work/_actions/pri-actions/gajira-login/v3/webpack:/@atlassian/gajira-login/common/net/Jira.js:111:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at module.exports.execute (/var/lib/ghactions/actions-runner/_work/_actions/pri-actions/gajira-login/v3/webpack:/@atlassian/gajira-login/action.js:17:1)
at exec (/var/lib/ghactions/actions-runner/_work/_actions/pri-actions/gajira-login/v3/dist/index.js:29732:20) {
req: {
method: 'GET',
body: undefined,
url: '***/rest/api/2/myself'
},
originError: FetchError: request to ***/rest/api/2/myself failed, reason: connect ETIMEDOUT 104.192.142.19:443
at ClientRequest. (/var/lib/ghactions/actions-runner/_work/_actions/pri-actions/gajira-login/v3/webpack:/@atlassian/gajira-login/node_modules/node-fetch/lib/index.js:1491:1)
at ClientRequest.emit (node:events:527:28)
at TLSSocket.socketErrorListener (node:_http_client:454:9)
at TLSSocket.emit (node:events:527:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
},
source: 'jira'
}

Jira server support?

HI team, any expectation to have this gajira-login to support JIRA Server instances, using PAT tokens?

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.