Generate a personal access token (classic) to access maven reposiotry #130
-
We do have two private repositories in our organization, let's call them: library and project. The library is hosted in the Maven GitHub repository. The project workflow is using a personal access token for authorization (according to documentation. Now we want to migrate to .github/workflows/example.ymljobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get token from Github App
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.GET_TOKEN_APP_ID }}
private-key: ${{ secrets.GET_TOKEN_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Set up Maven
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: 'maven'
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build and Package
run: |
cd project
mvn clean package
env:
MAVEN_USERNAME: ${{ github.actor }}
MAVEN_PASSWORD: ${{ steps.app-token.outputs.token }} I've tried multiple configurations but always end up with the following error:
What I'm guessing is that create-github-app-token doesn't support a personal access token. Could you confirm if this is the case? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
That is correct,
The |
Beta Was this translation helpful? Give feedback.
That is correct,
actions/create-github-app-token
creates installation access token (server-to-server tokens). Personal access tokens cannot be created programmatically without user interaction.The
//
looks odd, maybe an argument is missing, like an org name? I'm not familiar with maven I'm afraid