Scheduled Chores #155
This file contains 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
name: Scheduled Chores | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 0" # At 00:00 on Sunday | |
jobs: | |
check_api_versions: | |
runs-on: SFDO-Tooling-Ubuntu | |
outputs: | |
hub_version: ${{ steps.devhub-api-version.outputs.hub_version }} | |
cci_version: ${{ steps.cci-api-version.outputs.cci_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Get Dev Hub API Version | |
id: devhub-api-version | |
env: | |
HUB_URL: ${{ format('{0}/services/data', secrets.SFDO_HUB_URL) }} | |
run: | | |
version=$(curl -s $HUB_URL | jq -r '.[-1] | .version') | |
echo "hub_version=$version" >> $GITHUB_OUTPUT | |
- name: Get CURRENT_SF_API_VERSION | |
id: cci-api-version | |
run: | | |
version=$(yq '.project.package.api_version' cumulusci/cumulusci.yml) | |
echo "cci_version=$version" >> $GITHUB_OUTPUT | |
update_api_versions: | |
runs-on: SFDO-Tooling-Ubuntu | |
needs: check_api_versions | |
if: ${{ needs.check_api_versions.outputs.hub_version != needs.check_api_versions.outputs.cci_version }} | |
env: | |
VERSION: ${{ needs.check_api_versions.outputs.hub_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- name: Set CURRENT_SF_API_VERSION | |
id: set-cci-api-version | |
run: | | |
yq --indent 4 --inplace ' | |
.project.package.api_version = strenv(VERSION) | |
' cumulusci/cumulusci.yml | |
- name: Commit changes | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git switch -c "update-sfdc-api-v$VERSION" | |
git add cumulusci/cumulusci.yml | |
git commit -m "Automated update to sfdc API version $VERSION" | |
git push origin "update-sfdc-api-v$VERSION" | |
- env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh pr create --fill --label 'auto-pr' | |
test_sfdx_release_candidate: | |
uses: ./.github/workflows/release_test_sfdx.yml | |
with: | |
sfdx-release-channel: stable-rc | |
secrets: | |
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }} | |
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }} | |
CCITEST_APP_KEY: ${{ secrets.CCITEST_APP_KEY }} | |
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }} | |
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }} | |
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }} | |
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }} |