atlassian / gajira-cli

Other
38 stars 25 forks source link

Authentication not working, not reading $HOME/.jira.d/credentials #2

Open rocketraman opened 4 years ago

rocketraman commented 4 years ago

The gajira-login action creates $HOME/.jira.d/credentials however the CLI does not seem to read it.

redditblog commented 4 years ago

@rocketraman redditblog

JesseBowling commented 3 years ago

I'm experiencing the same issue with this workflow:

---
name: Jira CLI

on: push

jobs:
  jira_session:
    runs-on: ubuntu-latest
    steps:
      - name: Setup
        id: setup_jira_cli
        uses: atlassian/gajira-cli@v2.0.2

      - name: Login to Jira
        id: login_jira
        uses: atlassian/gajira-login@v2.0.0
        env:
          JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
          JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
          JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

      - name: Open session
        id: open_session
        run: jira session

This results in the following failure due to prompting for the API-Token:

Run jira session
  jira session
  shell: /usr/bin/bash -e {0}
ERROR EOF
? Jira API-Token [***]:  [? for help] 25l
Error: Process completed with exit code 1.

Similar flows using other Actions (i.e., Create issue) have no issues performing authenticated actions.

rocketraman commented 3 years ago

A workaround is to add the JIRA_API_TOKEN to the cli action:

      env:
        JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}