1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Fix some YAML (#52433)

Co-authored-by: Felicity Chapman <felicitymay@github.com>
This commit is contained in:
Ben Ahmady
2024-09-26 16:46:00 +01:00
committed by GitHub
parent 35760e6f2d
commit 854ab24c85
7 changed files with 46 additions and 44 deletions

View File

@@ -116,7 +116,7 @@ jobs:
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Build app
...
# ...
```
{% note %}

View File

@@ -98,20 +98,20 @@ steps:
- name: Checkout repository
uses: {% data reusables.actions.action-checkout %}
# Initializes CodeQL tools and creates a codebase for analysis.
- name: Initialize CodeQL
uses: {% data reusables.actions.action-codeql-action-init %}
with:
languages: {% raw %}${{ matrix.language }}{% endraw %}
- if: {% raw %}${{ matrix.build-mode == 'manual' }}{% endraw %}
name: Build C and C++ code
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
# Initializes CodeQL tools and creates a codebase for analysis.
- name: Initialize CodeQL
uses: {% data reusables.actions.action-codeql-action-init %}
with:
languages: {% raw %}${{ matrix.language }}{% endraw %}
- if: {% raw %}${{ matrix.build-mode == 'manual' }}{% endraw %}
name: Build C and C++ code
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
```
{% endif %}

View File

@@ -23,7 +23,7 @@ If you're using advanced setup and your workflow doesn't explicitly specify the
permissions:
security-events: write
actions: read
...
# ...
strategy:
fail-fast: false
matrix: {% ifversion codeql-language-identifiers-311 %}
@@ -31,7 +31,7 @@ If you're using advanced setup and your workflow doesn't explicitly specify the
language: ['csharp', 'cpp', 'javascript'] {% endif %}
steps:
...
# ...
- name: Initialize {% data variables.product.prodname_codeql %}
uses: {% data reusables.actions.action-codeql-action-init %}
with:

View File

@@ -48,7 +48,7 @@ Remove the lines from the {% data variables.product.prodname_codeql %} workflow.
- name: Initialize {% data variables.product.prodname_codeql %}
uses: {% data reusables.actions.action-codeql-action-init %}
...
# ...
```
For more information about editing the {% data variables.product.prodname_codeql %} workflow file, see "[AUTOTITLE](/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#editing-a-code-scanning-workflow)."

View File

@@ -177,8 +177,8 @@ Notice that all of the examples use a short version number for the action (`v3`)
# ([String]). Representing a path to a configuration file local to the repository or in an external repository.
# Possible values: An absolute path to a local file or an external file.
config-file: './.github/dependency-review-config.yml'
# Syntax for an external file: OWNER/REPOSITORY/FILENAME@BRANCH
config-file: 'github/octorepo/dependency-review-config.yml@main'
# Optional alternative syntax for an external file: OWNER/REPOSITORY/FILENAME@BRANCH (uncomment if preferred)
# config-file: 'github/octorepo/dependency-review-config.yml@main'
# ([Token]) Use if your configuration file resides in a private external repository.
# Possible values: Any GitHub token with read access to the private external repository.

View File

@@ -121,16 +121,17 @@ jobs:
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
# Parses the response from the API query and stores the relevant IDs as environment variables. Modify this to get the ID for different fields or options. For example:
#
# - To get the ID of a field called `Team`, add `echo 'TEAM_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") | .id' project_data.json) >> $GITHUB_ENV`.
# - To get the ID of an option called `Octoteam` for the `Team` single select field, add `echo 'OCTOTEAM_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") |.options[] | select(.name=="Octoteam") |.id' project_data.json) >> $GITHUB_ENV`.
#
# **Note:** This workflow assumes that you have a project with a single select field called "Status" that includes an option called "Todo" and a date field called "Date posted". You must modify this section to match the fields that are present in your table.
# Parses the response from the API query and stores the relevant IDs as environment variables. Modify this to get the ID for different fields or options. For example:
#
# - To get the ID of a field called `Team`, add `echo 'TEAM_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") | .id' project_data.json) >> $GITHUB_ENV`.
# - To get the ID of an option called `Octoteam` for the `Team` single select field, add `echo 'OCTOTEAM_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") |.options[] | select(.name=="Octoteam") |.id' project_data.json) >> $GITHUB_ENV`.
#
# **Note:** This workflow assumes that you have a project with a single select field called "Status" that includes an option called "Todo" and a date field called "Date posted". You must modify this section to match the fields that are present in your table.
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Todo") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
# Sets environment variables for this step. `GH_TOKEN` is the token generated in the first step. `PR_ID` is the ID of the pull request that triggered this workflow.
- name: Add PR to project
@@ -148,8 +149,8 @@ jobs:
}
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectV2ItemById.item.id')"
# Stores the ID of the created item as an environment variable.
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
# Stores the ID of the created item as an environment variable.
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
# Saves the current date as an environment variable in `yyyy-mm-dd` format.
- name: Get date
@@ -253,16 +254,17 @@ jobs:
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
# Parses the response from the API query and stores the relevant IDs as environment variables. Modify this to get the ID for different fields or options. For example:
#
# - To get the ID of a field called `Team`, add `echo 'TEAM_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") | .id' project_data.json) >> $GITHUB_ENV`.
# - To get the ID of an option called `Octoteam` for the `Team` single select field, add `echo 'OCTOTEAM_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") |.options[] | select(.name=="Octoteam") |.id' project_data.json) >> $GITHUB_ENV`.
#
# **Note:** This workflow assumes that you have a project with a single select field called "Status" that includes an option called "Todo" and a date field called "Date posted". You must modify this section to match the fields that are present in your table.
# Parses the response from the API query and stores the relevant IDs as environment variables. Modify this to get the ID for different fields or options. For example:
#
# - To get the ID of a field called `Team`, add `echo 'TEAM_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") | .id' project_data.json) >> $GITHUB_ENV`.
# - To get the ID of an option called `Octoteam` for the `Team` single select field, add `echo 'OCTOTEAM_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") |.options[] | select(.name=="Octoteam") |.id' project_data.json) >> $GITHUB_ENV`.
#
# **Note**: This workflow assumes that you have a project with a single select field called "Status" that includes an option called "Todo" and a date field called "Date posted". You must modify this section to match the fields that are present in your table.
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Todo") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
# Sets environment variables for this step. Replace `YOUR_TOKEN` with the name of the secret that contains your {% data variables.product.pat_generic %}.
- name: Add PR to project
@@ -280,8 +282,8 @@ jobs:
}
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectV2ItemById.item.id')"
# Stores the ID of the created item as an environment variable.
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
# Stores the ID of the created item as an environment variable.
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
# Saves the current date as an environment variable in `yyyy-mm-dd` format.
- name: Get date

View File

@@ -53,7 +53,7 @@ For more information, see the [`deploy-pages`](https://github.com/marketplace/ac
{% raw %}
```yaml
...
# ...
jobs:
deploy:
@@ -70,7 +70,7 @@ jobs:
- name: Deploy artifact
id: deployment
uses: actions/deploy-pages@v1
...
# ...
```
{% endraw %}
@@ -80,7 +80,7 @@ jobs:
You can link your `build` and `deploy` jobs in a single workflow file, eliminating the need to create two separate files to get the same result. To get started on your workflow file, under `jobs` you can define a `build` and `deploy` job to execute your jobs.
```yaml
...
# ...
jobs:
# Build job
@@ -111,13 +111,13 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
...
# ...
```
In certain cases, you might choose to combine everything into a single job, especially if there is no need for a build process. Consequently, you would solely focus on the deployment step.
```yaml
...
# ...
jobs:
# Single deploy job no building
@@ -140,7 +140,7 @@ jobs:
id: deployment
uses: actions/deploy-pages@v2
...
# ...
```
You can define your jobs to be run on different runners, sequentially, or in parallel. For more information, see "[AUTOTITLE](/actions/using-jobs)."