Skip to content

Extensions - Update Ballerina Version #1144

Extensions - Update Ballerina Version

Extensions - Update Ballerina Version #1144

name: Extensions - Update Ballerina Version
on:
workflow_dispatch:
inputs:
isRetrigger:
description: 'Re-trigger a failed dependency bump workflow'
required: false
default: 'false'
skipLang:
description: 'Skip lang version update'
required: false
default: 'false'
ballerinaVersion:
description: 'Ballerina Version (Mandatory only when re-triggering failed workflow)'
required: false
default: ''
autoMergePRs:
description: 'Auto Merge PRs'
required: false
default: 'true'
sendNotification:
description: 'Send failure notification to Google Chat'
required: false
default: 'true'
# schedule:
# - cron: '30 6 * * *'
jobs:
update-lang-version:
name: Update Ballerina Lang Version
if: github.repository_owner == 'ballerina-platform'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}-dependency-update
cancel-in-progress: true
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Python Packages
run: |
pip install requests
pip install retry
pip install PyGithub
pip install httplib2
pip install cryptography
- name: Update Ballerina Language Version
run: |
if ${IS_SCHEDULE_WORKFLOW} == true; then
echo "Schedule Workflow Triggered"
python dependabot/update_dependencies_in_pipeline.py "false" "false" "" "true" "true" "schedule"
else
echo "Manual Trigger"
python dependabot/update_dependencies_in_pipeline.py "${{ github.event.inputs.isRetrigger }}" \
"${{ github.event.inputs.skipLang }}" \
"${{ github.event.inputs.ballerinaVersion }}" \
"${{ github.event.inputs.autoMergePRs }}" \
"${{ github.event.inputs.sendNotification }}"
fi
env:
IS_SCHEDULE_WORKFLOW: ${{ github.event_name == 'schedule' }}
BALLERINA_BOT_USERNAME: ${{ secrets.BALLERINA_BOT_USERNAME }}
BALLERINA_BOT_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
BALLERINA_BOT_EMAIL: ${{ secrets.BALLERINA_BOT_EMAIL }}
BALLERINA_REVIEWER_BOT_TOKEN: ${{ secrets.BALLERINA_REVIEWER_BOT_TOKEN }}
CHAT_ID: ${{ secrets.NOTIFICATIONS_CHAT_ID }}
CHAT_KEY: ${{ secrets.NOTIFICATIONS_CHAT_KEY }}
CHAT_TOKEN: ${{ secrets.NOTIFICATIONS_CHAT_TOKEN }}
ENV_USER_ENCRYPTION_KEY: ${{secrets.USER_ENCRYPTION_KEY}}
- name: Trigger Dashboard Update
if: always()
run: |
curl -X POST \
https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: token ${{ secrets.BALLERINA_BOT_TOKEN }}' \
--data "{
\"event_type\": \"dashboard-update\",
\"client_payload\": {
\"sendNotification\": \"false\"
}
}"