title: How to access Maven dependency from Github Packages on a Github Actions workflow?
body: <p>My build is working locally by using a User + PAT (personal access token) directly on the <code>pom.xml</code> <code>&lt;repository&gt;</code> element:</p>
  <pre><code>&lt;repository&gt;
      &lt;id&gt;github&lt;/id&gt;
      &lt;name&gt;GitHub Packages&lt;/name&gt;
      &lt;url&gt;https://[USER]:[PAT]@maven.pkg.github.com/myaccount/myrepo&lt;/url&gt;
  &lt;/repository&gt;
  </code></pre>
  <blockquote>
  <p>Downloaded from github:
  https://[USER]:[PAT]@maven.pkg.github.com/myaccount/myrepo/org/springframework/flex/spring-flex-core/1.6.1.BUILD-SNAPSHOT/maven-metadata.xml
  (796 B at 592 B/s)</p>
  </blockquote>
  <p>I have no <code>settings.xml</code> configured.</p>
  <p>However, it is breaking on a Github Actions workflow:</p>
  <blockquote>
  <p>Warning:  Could not transfer metadata
  org.springframework.flex:spring-flex-core:1.6.1.BUILD-SNAPSHOT/maven-metadata.xml
  from/to github (***maven.pkg.github.com/myaccount/myrepo):
  Authentication failed for
  <a href="https://maven.pkg.github.com/myaccount/myrepo/org/springframework/flex/spring-flex-core/1.6.1.BUILD-SNAPSHOT/maven-metadata.xml" rel="noreferrer">https://maven.pkg.github.com/myaccount/myrepo/org/springframework/flex/spring-flex-core/1.6.1.BUILD-SNAPSHOT/maven-metadata.xml</a> 401 Unauthorized</p>
  </blockquote>
  <blockquote>
  <p>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</p>
  </blockquote>
  <p>My workflow is like this:</p>
  <pre><code>steps:
        - uses: actions/checkout@v2
        - name: Set up JDK 1.8
          uses: actions/setup-java@v1
          with:
            java-version: 1.8
        - name: Cache Maven packages
          uses: actions/cache@v2
          with:
            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
  </code></pre>
  <p>Why does it break on Github workflow?</p>