Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reasource not Available by Integration #249

Closed
JackatDJL opened this issue Oct 18, 2023 · 5 comments
Closed

Reasource not Available by Integration #249

JackatDJL opened this issue Oct 18, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@JackatDJL
Copy link

JackatDJL commented Oct 18, 2023

Bug description
Hello People of Game-CI
i would like some help:
i keep geting a error:
Resource not Available by Integration
Log at the bottom

Thank you in front

How to reproduce

  1. Copy my Ci.yaml
  2. Test a Project
  3. Get a Error

Expected behavior

Testing The Project

Additional details

My CI.yaml:

name: Automatic CI 🤖

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

on:
  pull_request:
  workflow_dispatch:

jobs:
  testRunner:
    name: Test in ${{ matrix.testMode }} ✨
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code ✅
        uses: actions/checkout@v4

      - name: Create LFS file list 📜
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache 🔄
        uses: actions/cache@v3
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull 📥
        run: |
          git lfs pull
          git add .
          git reset --hard
      - name: Restore Library cache 🔄
        uses: actions/cache@v3
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-
            
      - name: Run ${{ matrix.testMode }} Tests ⏯ 📑
        id: runningTest
        uses: game-ci/[email protected]
        with:
          projectPath: ${{ vars.projectPath }}
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      # Upload artifacts
      - name: Upload Artifact 📦
        uses: actions/upload-artifact@v3
        with:
          name: Test results (${{ matrix.testMode }}) 📑
          path: ${{ steps.runningTest.outputs.artifactsPath }}

Log:
Pastebin

@JackatDJL JackatDJL added the bug Something isn't working label Oct 18, 2023
@GabLeRoux
Copy link
Member

This is exactly related to the following StackOverflow:
https://stackoverflow.com/questions/70435286/resource-not-accessible-by-integration-on-github-post-repos-owner-repo-ac

This happens because the pipeline doesn't have the right to publish the report for the tests.

A quick fix is to go in project's settings > Workflow Permissions section and give actions Read and Write permissions.

@AndrewKahr AndrewKahr transferred this issue from game-ci/unity-actions Dec 12, 2023
@GabLeRoux
Copy link
Member

Closing this as I'm quite sure the answer solves the issue. I've encountered this a few times and this was the solution.

@shloon
Copy link

shloon commented Dec 14, 2023

Hi, a better fix is to explicitly add the required permissions to the job using this action, e.g.:

jobs:
  test:
    permissions:
      checks: write
...
    steps:
      - name: Run Tests
        uses: game-ci/unity-test-runner@v4

You can see that in action in my own repo here: https://github.com/shloon/Event-Horizon/blob/b13d2c16be65e5ce1b6fc0e0fd3bbf4bab9ec434/.github/workflows/ci.yml#L8

I think it's worth adding to the documentation at the very least.

@GabLeRoux GabLeRoux reopened this Dec 14, 2023
@GabLeRoux
Copy link
Member

GabLeRoux commented Dec 14, 2023

💯 oh, agreed, @shloon if you'd like to open a PR for this in the docs, it would be very nice 🙏 Edit: created issue here: game-ci/documentation#443

@JackatDJL
Copy link
Author

It worked,
Thank you :)

mathias-bevers added a commit to mathias-bevers/term2.4-personal-portfolio that referenced this issue Jul 3, 2024
- run failed due to the 'Resource not accessible by integration' error.
- added the write permission to the job, it was suggested by: game-ci/unity-test-runner#249.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants