forked from scottsauber/github-actions-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Secrets #8
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
Open
erisjak
wants to merge
19
commits into
main
Choose a base branch
from
secrets
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Secrets #8
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e9fd2f5
add a new line to weather forecast
erisjak 54a2e25
neues feature
erisjak 5b5cb7b
add dotnet test to pr verify
erisjak b6cd175
add failing test
erisjak 9d5396e
fix test
erisjak 5d8353a
add dotnet format to pr verify
erisjak c9d3ebd
changed .NET version to 9
erisjak 5b4af6f
switch back to .NET 8
erisjak dab650e
fixed formatting
erisjak 8336c9b
test code ql
erisjak ba93324
add ci
erisjak 35a7bfb
upload artifacts as part of CI
erisjak 051ca6f
add cron job
erisjak 52f1c35
edited cron job
erisjak 8651f20
added secrets branch
erisjak 299f787
Merge branch 'main' into secrets
erisjak e35613a
add a job
erisjak ec5d887
added new job to secrets
erisjak c4ddacb
delete cron job
erisjak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Secrets workflow | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["main"] | ||
|
|
||
| env: | ||
| API_CSPROJ_PATH: "./src/GithubActionsDotnet.Api/GithubActionsDotnet.Api.csproj" | ||
|
|
||
| jobs: | ||
| secrets: | ||
| name: Secrets Demo | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| JOB_NAME: "secrets" | ||
| steps: | ||
| - name: Echo environment variable | ||
| run: curl -h API_KEY | ||
|
|
||
| new_job: | ||
| name: Secrets Demo | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| JOB_NAME: "new_job" | ||
| steps: | ||
| - name: Echo environment variable | ||
| run: echo "The value of $JOB_NAME is $API_CSPROJ_PATH" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 5 months ago
To fix this issue, add a
permissionsblock at the workflow root or job level, specifying the least required privileges. In this workflow, the jobs simply echo environment variables and usecurl, so neither requires any write access to the repository. The best practice is to add the following block at the top level (applies to all jobs unless individually overridden):This should be placed just below the
namefield and prior toon. Alternatively, you could add it within each job, but for conciseness and maintainability, the root-level block is preferred. No new imports or definitions are needed.