Code Monkey home page Code Monkey logo

Comments (12)

ashokvaddevalli avatar ashokvaddevalli commented on September 16, 2024 1

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

  • name: Deploy Allure report to GitHub Pages
    if: always() # Execute even if previous steps fail
    run: |
    # Configure git
    git config --global user.name "${{ github.actor }}"
    git config --global user.email "${{ github.actor }}@se.com"

       # Checkout the gh-pages branch
       git fetch origin
       git checkout -B gh-pages origin/gh-pages
    
       # Copy the new report to the gh-pages branch
       mkdir -p auto_test_report/${{ github.run_number }}  
       cp -r allure-report/index.html auto_test_report/${{ github.run_number }}
       # mkdir -p auto_test_report/latest
       cp -r allure-report/index.html auto_test_report/latest
    
       # Commit and push the changes
       git add auto_test_report/${{ github.run_number }}/index.html auto_test_report/latest/index.html
       git commit -m "Update Allure test report"
       git push origin gh-pages
     env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 
    

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

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

from actions-gh-pages.

ashokvaddevalli avatar ashokvaddevalli commented on September 16, 2024

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 4f9cc66 but we are facing the issue. Any dependent actions for this action?

image

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

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.

from actions-gh-pages.

ashokvaddevalli avatar ashokvaddevalli commented on September 16, 2024

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

image

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

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/[email protected]/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."

from actions-gh-pages.

ashokvaddevalli avatar ashokvaddevalli commented on September 16, 2024

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.
4f9cc66

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

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.

from actions-gh-pages.

ashokvaddevalli avatar ashokvaddevalli commented on September 16, 2024

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

  • name: Publish test report
    uses: peaceiris/actions-gh-pages@v3
    if: always()
    with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_branch: gh-pages
    publish_dir: allure-history

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

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

from actions-gh-pages.

ashokvaddevalli avatar ashokvaddevalli commented on September 16, 2024

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:
- uses: actions/checkout@v3

  - name: Set up JDK
    uses: actions/setup-java@v3
    with:
      distribution: zulu
      java-version: 17

  - name: Run tests
    run: ./gradlew clean test

  - name: Load test report history
    uses: actions/checkout@v3
    if: always()
    continue-on-error: true
    with:
      ref: gh-pages
      path: gh-pages

  - name: Build test report
    uses: simple-elf/[email protected]
    if: always()
    with:
      gh_pages: gh-pages
      allure_history: allure-history
      allure_results: build/allure-results

  - name: Publish test report
    uses: peaceiris/actions-gh-pages@v3
    if: always()
    with:
      github_token: ${{ secrets.GITHUB_TOKEN }}
      publish_branch: gh-pages
      publish_dir: allure-history

from actions-gh-pages.

github-actions avatar github-actions commented on September 16, 2024

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.

from actions-gh-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.