question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

github context is not accessible from step.uses

See original GitHub issue

Describe the bug It is not possible to use github context in jobs.<job_id>.steps[*].uses.

To Reproduce create workflow which uses github context within uses:

name: ci
on: [push, pull_request]
jobs:
  my_job:
    runs-on: ubuntu-latest
    steps:
      - name: this repo action
        uses: ${{ github.repository }}@${{ github.sha }}        

Expected behavior github.repository and github.sha are substituted with correspoonding values.

Runner Version and Platform

public runner

What’s not working?

github context variable substitution

Job Log Output

The workflow is not valid. .github/workflows/ci.yml (Line: 17, Col: 15): Unrecognized named-value: 'github'. Located at position 1 within expression: github.repository 

Runner and Worker’s Diagnostic Logs

https://github.com/myci-actions/add-deb-repo/actions/runs/469160309

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
TingluoHuangcommented, Apr 23, 2021

We don’t support expression in those place, you need to checkout the repo to use local action.

- uses: actions/checkout@v2
- uses: ./
3reactions
TingluoHuangcommented, Apr 23, 2021

We want the YAML file readable at some level, so we don’t open expressions for every part of the YAML file.

You can make a feature request at https://github.community/c/code-to-cloud/github-actions/41

The runner repo might not be a good place for this kind of question, it doesn’t understand YAML at all, the service parses the YAML and validates against a defined schema. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contexts - GitHub Docs
Contexts are a way to access information about workflow runs, variables, runner environments, jobs, and steps. Each context is an object that contains ......
Read more >
Why is env context not available in Github action job level if ...
The documentation reads. You can access this context from any step in a job. This object contains the properties listed below. ~ env...
Read more >
Context access might be invalid: strategy #113
Describe the bug Many invalid instances of Context access might be invalid throughout a workflow file. To Reproduce Steps to reproduce the ...
Read more >
[BUG] Resource not accessible by integration - Using ...
ps: i cant use GITHUB_TOKEN or any PAT, because im using this in a monorepo context, so I get a lot of rate-limit....
Read more >
GitHub Actions Security Best Practices [cheat sheet included]
Learn how to secure your GitHub Actions with these best practices! From controlling credentials to using specific action version tags, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found