Skip to content

Commit

Permalink
Merge pull request #43755 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Oct 4, 2023
2 parents 0cfffe4 + 3c7e291 commit 412cb91
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,11 @@ on:
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: {% data reusables.actions.action-checkout %}
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO={% raw %}${{ github.repository }}{% endraw %}
BRANCH="refs/pull/{% raw %}${{ github.event.pull_request.number }}{% endraw %}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
Expand All @@ -368,6 +362,8 @@ jobs:
echo "Done"
env:
GH_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
REPO: {% raw %}${{ github.repository }}{% endraw %}
BRANCH: refs/pull/{% raw %}${{ github.event.pull_request.number }}{% endraw %}/merge
```

Alternatively, you can use the API to automatically list or delete all caches on your own cadence. For more information, see "[AUTOTITLE](/rest/actions/cache#about-the-cache-in-github-actions)."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ You can use the `set-output` command in your workflow to set the same value:
```yaml copy
- name: Set selected color
run: echo '::set-output name=SELECTED_COLOR::green'
id: random-color-generator
id: color-selector
- name: Get color
{% raw %}
run: echo "The selected color is ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}"
run: echo "The selected color is ${{ steps.color-selector.outputs.SELECTED_COLOR }}"
{% endraw %}
```

Expand All @@ -118,10 +118,10 @@ You can use the `set-output` command in your workflow to set the same value:
```yaml copy
- name: Set selected color
run: Write-Output "::set-output name=SELECTED_COLOR::green"
id: random-color-generator
id: color-selector
- name: Get color
{% raw %}
run: Write-Output "The selected color is ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}"
run: Write-Output "The selected color is ${{ steps.color-selector.outputs.SELECTED_COLOR }}"
{% endraw %}
```

Expand Down Expand Up @@ -509,8 +509,8 @@ jobs:
GENERATED_SECRET=$((RANDOM))
echo "::add-mask::$GENERATED_SECRET"
SECRET_HANDLE=$(secret-store store-secret "$GENERATED_SECRET"){% ifversion actions-save-state-set-output-envs %}
echo "handle=$secret_handle" >> "$GITHUB_OUTPUT"{% else %}
echo "::set-output name=handle::$secret_handle"{% endif %}
echo "handle=$SECRET_HANDLE" >> "$GITHUB_OUTPUT"{% else %}
echo "::set-output name=handle::$SECRET_HANDLE"{% endif %}
secret-consumer:
runs-on: macos-latest
needs: secret-generator
Expand Down Expand Up @@ -921,11 +921,11 @@ This example demonstrates how to set the `SELECTED_COLOR` output parameter and l

```yaml copy
- name: Set color
id: random-color-generator
id: color-selector
run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT"
- name: Get color
env:{% raw %}
SELECTED_COLOR: ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}{% endraw %}
SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}{% endraw %}
run: echo "The selected color is $SELECTED_COLOR"
```

Expand All @@ -937,12 +937,12 @@ This example demonstrates how to set the `SELECTED_COLOR` output parameter and l

```yaml copy
- name: Set color
id: random-color-generator
id: color-selector
run: |
"SELECTED_COLOR=green" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: Get color
       env:{% raw %}
         SELECTED_COLOR: ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}{% endraw %}
env:{% raw %}
SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}{% endraw %}
run: Write-Output "The selected color is $env:SELECTED_COLOR"
```

Expand Down

0 comments on commit 412cb91

Please sign in to comment.