features/.github/workflows/update-dotnet-install-script.yml

50 lines
1.6 KiB
YAML
Raw Normal View History

Use dotnet-install.sh in .NET feature (#628) * Use dotnet-install.sh in .NET feature * Use latest.version files * Cleanup runtime args * Use latest.version files in tests as well * Improve tests, remove code duplication * Add stderr helper * Validate version inputs * Use suggested description Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Shorter version description Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Shorter version description Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Clean up apt lists * Verify 7.0 is latest * Fix PATH, add test for .NET global tools * Include a copy of dotnet-install.sh in the Feature * Configure useful env variables * Use stringly typed booleans * Keep imperative writing style in option hints * Update maintainers Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Move dotnet-install.sh into a vendor directory * Refactor variables * Amend * Amend 2 * Use default options from devcontainer-feature.json * Add back variables * Fix shellchek warning in fetch_latest_sdk_version * Inline install_version function * Fix ShellCheck warnings * Improve CSV parsing * Default to latest when configuring an empty version * Add support for runtime-only configurations * Move 'none' check higher up * Deduplicate helper functions, sort into files * Address the user more directly in NOTES * Remove unnecessary defaults * Replace feature -> Feature Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Add update-dotnet-install-script workflow * Apply suggestions from code review Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Don't skip ci for automated script update --------- Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
2023-09-11 21:16:24 +03:00
name: "Updates vendor 'dotnet-install' script"
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight UTC (adjust as needed)
jobs:
fetch-latest-dotnet-install:
runs-on: ubuntu-latest
environment: documentation # grants access to secrets.PAT, for creating pull requests
Use dotnet-install.sh in .NET feature (#628) * Use dotnet-install.sh in .NET feature * Use latest.version files * Cleanup runtime args * Use latest.version files in tests as well * Improve tests, remove code duplication * Add stderr helper * Validate version inputs * Use suggested description Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Shorter version description Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Shorter version description Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Clean up apt lists * Verify 7.0 is latest * Fix PATH, add test for .NET global tools * Include a copy of dotnet-install.sh in the Feature * Configure useful env variables * Use stringly typed booleans * Keep imperative writing style in option hints * Update maintainers Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Move dotnet-install.sh into a vendor directory * Refactor variables * Amend * Amend 2 * Use default options from devcontainer-feature.json * Add back variables * Fix shellchek warning in fetch_latest_sdk_version * Inline install_version function * Fix ShellCheck warnings * Improve CSV parsing * Default to latest when configuring an empty version * Add support for runtime-only configurations * Move 'none' check higher up * Deduplicate helper functions, sort into files * Address the user more directly in NOTES * Remove unnecessary defaults * Replace feature -> Feature Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Add update-dotnet-install-script workflow * Apply suggestions from code review Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com> * Don't skip ci for automated script update --------- Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
2023-09-11 21:16:24 +03:00
steps:
- uses: actions/checkout@v3
- name: Run fetch-latest-dotnet-install.sh
run: src/dotnet/scripts/fetch-latest-dotnet-install.sh
- name: Create a PR for dotnet-install.sh
id: push_image_info
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
set -e
echo "Start."
# Configure git and Push updates
git config --global user.email github-actions@github.com
git config --global user.name github-actions
git config pull.rebase false
branch=automated-script-update-$GITHUB_RUN_ID
git checkout -b $branch
message='[Updates] Automated vendor 'dotnet-install' script'
# Add / update and commit
git add src/dotnet/scripts/vendor/dotnet-install.sh
git commit -m 'Automated dotnet-install script update' || export NO_UPDATES=true
# Push
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch"
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${GITHUB_REPOSITORY}/pulls \
-f title="$message" \
-f body="$message" \
-f head="$branch" \
-f base="$GITHUB_REF_NAME"
fi