iterative / cml

♾️ CML - Continuous Machine Learning | CI/CD for ML
http://cml.dev
Apache License 2.0
3.99k stars 333 forks source link

Resource not accessible by integration Http error. #1421

Closed Sandy0002 closed 11 months ago

Sandy0002 commented 11 months ago

I am new to CML and trying to learn it so I copied this code and pasted in my cml.yaml file. But it is giving me "Resource not accessible by integration/HTTPError".

  name: your-workflow-name
  on: [push]
  jobs:
    run:
      runs-on: ubuntu-latest
      # optionally use a convenient Ubuntu LTS + DVC + CML image
      # container: ghcr.io/iterative/cml:0-dvc2-base1
      steps:
        - uses: actions/checkout@v3
        # may need to setup NodeJS & Python3 on e.g. self-hosted
        # - uses: actions/setup-node@v3
        #   with:
        #     node-version: '16'
        # - uses: actions/setup-python@v4
        #   with:
        #     python-version: '3.x'
        - uses: iterative/setup-cml@v1
        - name: Train model
          run: |
            # Your ML workflow goes here
            pip install -r requirements.txt
            python train.py
        - name: Write CML report
          env:
            REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          run: |
            # Post reports as comments in GitHub PRs
            cat results.txt >> report.md
            cml comment create report.md

What should I do?

0x2b3bfa0 commented 11 months ago

Hello, @Sandy0002! Can you please try adding this to your workflow?

permissions:
  contents: read
  pull-requests: write
Sandy0002 commented 11 months ago

Thank you @0x2b3bfa0 that was a pretty quick response.

This solution worked.

Sandy0002 commented 11 months ago

I wanted to ask why that error happened like is it due to repository default access permissions or something else.

0x2b3bfa0 commented 11 months ago

https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only