peaceiris / actions-gh-pages

GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.
https://github.com/marketplace/actions/github-pages-action
MIT License
4.65k stars 368 forks source link

support: Error: Unable to resolve actions. Cannot access repositories 'peaceiris/actions-gh-pages' #1083

Closed ashokvaddevalli closed 3 months ago

ashokvaddevalli commented 3 months ago

Checklist

Describe your question

We are facing issues using this action on Github Enterprise.

Error: Unable to resolve actions. Cannot access repositories 'peaceiris/actions-gh-pages'. Enable access using Settings in the Action repository. See https://docs.github.com/enterprise-server@3.12/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository for more information.

Relevant links

Public repository:
YAML config:
YAML workflow:
 - name: Get Allure history
        uses: actions/checkout@v3
        if: always()
        continue-on-error: true
        with:
          ref: gh-pages
          path: gh-pages
      - name: Allure report action
        uses: simple-elf/allure-report-action@58e6590adf6d8f196a0d771bf8a00e6921086a62
        if: always()
        with:
          allure_results: allure-report
          allure_history: allure-history
          keep_reports: 10
      - name: Deploy Allure report to GitHub Pages
        uses: peaceiris/actions-gh-pages@v4
        if: always()
        with:
          github_token: ${{ secrets.GHE_TOKEN }}
          publish_branch: gh-pages
           publish_dir: allure-history

Relevant log output

Getting action download info Error: Unable to resolve actions. Cannot access repositories 'peaceiris/actions-gh-pages'. Enable access using Settings in the Action repository. See https://docs.github.com/enterprise-server@3.12/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository for more information.

Additional context.

No response

peaceiris commented 3 months ago

Please check your repository setting.

cf. https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-select-actions-and-reusable-workflows-to-run

スクリーンショット 2024-06-24 午前10 35 34

ashokvaddevalli commented 3 months ago

Hi @peaceiris We are using GitHub Enterprise, and we can't enable all actions due to security reasons. We are enabling the required actions as per request. We are enabled this action peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e but we are facing the issue. Any dependent actions for this action?

image

peaceiris commented 3 months ago

We must use the same declaration for the workflow file and allow list, I expect.

When we pin a custom action in the allow list by a commit hash, we need to use the commit hash in our YAML workflow file.

ashokvaddevalli commented 3 months ago

I tried using commit has only, but the issue is the same.

image

peaceiris commented 3 months ago

Ahh, it seems that we cannot override a policy managed by the enterprise. Could you ask the enterprise owners to add this action to the allow list using the commit hash?

https://docs.github.com/en/enterprise-server@3.12/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-select-actions-to-run

[!NOTE] You might not be able to manage these settings if your organization has an overriding policy or is managed by an enterprise that has overriding policy. For more information, see "Disabling or limiting GitHub Actions for your organization" or "Enforcing policies for GitHub Actions in your enterprise."

ashokvaddevalli commented 3 months ago

Hi, This action is already enabled after my request, but I am facing this issue. We are using other actions, but we are not seeing this issue, and we are facing issues with using this action. peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e

peaceiris commented 3 months ago

Oh, sorry. I have no more idea about this...

Today, the official custom GitHub Action to deploy GitHub Pages is available. We can try it.

ashokvaddevalli commented 3 months ago

Hi, Using deploy-pages action, i have not seen publish_branch and publish_dir options.

peaceiris commented 3 months ago

Also, we need the actions/upload-pages-artifact to upload our publish_dir.

Here is an example workflow (not tested).

name: Pages

on:
  push:
    branches:
      - main

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Build
        run: build_something

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: "publish_dir"

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4
ashokvaddevalli commented 3 months ago

I am trying to publish allure reports, and we want access to previous reports as well. I am trying to use the below action.

name: Run tests and publish report on: [push] jobs: test: runs-on: ubuntu-latest steps:

ashokvaddevalli commented 3 months ago

I have tried without gh-pages action and it is working fine.

github-actions[bot] commented 3 months ago

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved. If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

Log | Bot Usage