Skip to content

Auto Update

Auto Update #5598

Workflow file for this run

name: Auto Update
on:
workflow_dispatch: # Enable manual trigger
inputs:
forced_packages:
description: The list of packages to forcibly update (like "pkg1:ver1 pkg2")
required: false
schedule:
- cron: '5 0/8 * * *'
push:
branches:
- package/*
jobs:
auto_update:
runs-on: windows-2022
defaults:
run:
shell: powershell
permissions:
contents: write
timeout-minutes: 15
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 30
submodules: recursive
- name: Check a build environment
run: |
Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version
$PSVersionTable
git --version
choco --version
- name: Initialize Git config
run: |
git config --global user.email "chocolatey@realdimensions.net"
git config --global user.name "Chocolatey"
git config --global core.safecrlf false
- name: Install AU
run: Install-Module Chocolatey-AU -Force
- name: Check update for packages
run: ./update_all.ps1 -ForcedPackages "$env:FORCED_PACKAGES"
env:
FORCED_PACKAGES: ${{ github.event.inputs.forced_packages }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # To authenticate GitHub CLI
AU_DRY_RUN: ${{ github.event_name == 'push' }}
# Github token to commit pushed packages to repository
github_user_repo: ${{ github.repository }}
github_api_key: ${{ secrets.AU_GITHUB_API_KEY }}
# ID of the gist used to save run results - create a gist under the github_user (secret or not) and grab the id - https://gist.github.com/name/id
# Optional, leave empty to create anonymous gist
gist_id: bcca7b715c28d0fad4e2364eb5340438
# Force test: gist id for test results
gist_id_test:
# Chocolatey API key - to push updated packages
api_key: ${{ secrets.CHOCOLATEY_API_KEY }}
# Slack webhook URL
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
# GitHub Actions build url which points to this build
GH_ACTIONS_BUILD_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Archive AU temporary files
if: always()
run: 7z a au_temp.zip $Env:TEMP\chocolatey\au\*
- name: Upload update results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: update_results
path: |
update_info.xml
Update-AUPackages.md
au_temp.zip
**/*.nupkg