Workflow cannot access artifact in Packages Maven repo using basic authentication

I’ve uploaded my artifact to Packages and my build is working LOCALLY by using basic auth (User + PAT (personal access token)) directly on the pom.xml <repository> element:

    <name>GitHub Packages</name>

Downloaded from github: https://[USER]:[PAT] (796 B at 592 B/s)

I have no settings.xml configured.

However, it is breaking on a Github Actions workflow:

Warning: Could not transfer metadata org.springframework.flex:spring-flex-core:1.6.1.BUILD-SNAPSHOT/maven-metadata.xml from/to github (*** Authentication failed for 401 Unauthorized

Failed to collect dependencies at org.springframework.flex:spring-flex-core:jar:1.6.1.BUILD-SNAPSHOT: Failed to read artifact descriptor for org.springframework.flex:spring-flex-core:jar:1.6.1.BUILD-SNAPSHOT

My workflow is like this:

      - uses: actions/checkout@v2
      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
          java-version: 1.8
      - name: Cache Maven packages
        uses: actions/cache@v2
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2
      - name: Build with Maven
        run: mvn -B package --file dev/server/pom.xml

Why wouldn’t this work on Github workflow? Is it the maven version?