Can github action create a release to a public repo from a private repo?

I want to create a release that contains assets for users to download. Since it is a private repo, I want to create the release in a separate public repo. Is this doable in Github Action?

There are owner and repo parameters in create-release action, but I kept getting errors after setting them to a different repo:

  - name: Create Release
    id: create_release
    uses: actions/create-release@v1
      GITHUB_TOKEN: ${{ secrets.PAT }} # A personal access token
      tag_name: ${{ github.ref }}
      release_name: Release ${{ github.ref }}
      draft: false
      prerelease: false
      owner: foo
      repo: another_public_repo

yields this error:

Error: Validation Failed:
is not a valid tag”},
{“resource”:“Release”,“code”:“custom”,“message”:“Published releases
must have a valid tag”},

Hi @xhliu, welcome to the GitHub Support Community!

It is possible to do this with this action, yes, though it looks like the error you’re getting is because you’re passing an invalid tag name. The github.ref contents can change depending on the event that triggers the workflow run—it can be a branch, tag, or null. You can check which type is included in the github.ref for each event on this page:

Could you post what events are triggering your workflows—what’s inside your on definition? It may also be helpful to have a link to your workflow file directly.

If you’re listening on pushes then it may be worth to filter only for pushes on tags if you’re not doing so already:

      - 'v*' # Push events to matching v*, i.e. v1.0, v2.1.0