Remove redundant environment variable declarations from Workflows

This commit is contained in:
Patryk Michalik
2021-06-10 18:26:46 +02:00
parent 115bd857d3
commit 7f71b7d47c
4 changed files with 3 additions and 9 deletions

View File

@@ -85,8 +85,6 @@ jobs:
run: python send_changelog.py
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REPO: ${{ github.repository }}
TELEGRAM_CI_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }}
TELEGRAM_CI_CHANNEL_ID: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }}
BRANCH: 11-dev

View File

@@ -85,8 +85,6 @@ jobs:
run: python send_changelog.py
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REPO: ${{ github.repository }}
TELEGRAM_CI_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }}
TELEGRAM_CI_CHANNEL_ID: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }}
BRANCH: 11-alpha

View File

@@ -32,8 +32,6 @@ jobs:
run: python send_changelog.py
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REPO: ${{ github.repository }}
TELEGRAM_CI_BOT_TOKEN: ${{ secrets.NOTIFY_BOT_TOKEN }}
TELEGRAM_CI_CHANNEL_ID: ${{ secrets.NOTIFY_CHANNEL_ID }}
BRANCH: ${{ github.ref }}

View File

@@ -5,7 +5,7 @@ import requests
github_event_before = os.getenv('GITHUB_EVENT_BEFORE')
github_sha = os.getenv('GITHUB_SHA')
github_repo = os.getenv('GITHUB_REPO')
github_repository = os.getenv('GITHUB_REPOSITORY')
telegram_ci_bot_token = os.getenv('TELEGRAM_CI_BOT_TOKEN')
telegram_ci_channel_id = os.getenv('TELEGRAM_CI_CHANNEL_ID')
branch = os.getenv('BRANCH')
@@ -14,13 +14,13 @@ repository = git.Repo('.')
commits_range = f'{github_event_before}...{github_sha}'
commits = list(repository.iter_commits(commits_range))
overview_link = f'https://github.com/{github_repo}/compare/{commits_range}'
overview_link = f'https://github.com/{github_repository}/compare/{commits_range}'
overview_link_tag = f'''<a href="{overview_link}">{len(commits)} new commit{'s' if len(commits) > 1 else ''}</a>'''
message = f'''<b>🔨 {overview_link_tag} to <code>lawnchair:{branch}</code>:</b>\n'''
for commit in commits:
commit_message = commit.message.split('\n')[0]
commit_link = f'https://github.com/{github_repo}/commit/{commit.hexsha}'
commit_link = f'https://github.com/{github_repository}/commit/{commit.hexsha}'
commit_link_tag = f'<a href="{commit_link}">{repository.git.rev_parse(commit.hexsha, short=7)}</a>'
encoded_message = html.escape(commit_message)
message += f'\n{commit_link_tag}: {encoded_message}'