Skip to content

Commit

Permalink
Merge pull request #7 from saadmk11/naming-update
Browse files Browse the repository at this point in the history
Fix inconsistent naming
  • Loading branch information
saadmk11 authored Apr 8, 2021
2 parents 4431b56 + 7625908 commit 88abfc2
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version: v0.5.0

* [#1](https://github.com/saadmk11/github-action-upgrade/pull/1): Create LICENSE
* [#2](https://github.com/saadmk11/github-action-upgrade/pull/2): Add ignore option to ignore particular action updates
* [#3](https://github.com/saadmk11/github-action-upgrade/pull/3): Add documentation
* [#4](https://github.com/saadmk11/github-action-upgrade/pull/4): Add Changelog CI
* [#1](https://github.com/saadmk11/github-actions-version-updater/pull/1): Create LICENSE
* [#2](https://github.com/saadmk11/github-actions-version-updater/pull/2): Add ignore option to ignore particular action updates
* [#3](https://github.com/saadmk11/github-actions-version-updater/pull/3): Add documentation
* [#4](https://github.com/saadmk11/github-actions-version-updater/pull/4): Add Changelog CI
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM python:3.8

LABEL "com.github.actions.name"="GitHub Action Updater"
LABEL "com.github.actions.description"="GitHub Action Updater updates GitHub action version and creates a pull request with the changes."
LABEL "com.github.actions.name"="GitHub Actions Version Updater"
LABEL "com.github.actions.description"="GitHub Actions Version Updater updates GitHub Action versions in a repository and creates a pull request with the changes."
LABEL "com.github.actions.icon"="upload-cloud"
LABEL "com.github.actions.color"="green"

LABEL "repository"="https://github.com/saadmk11/github-action-upgrade"
LABEL "homepage"="https://github.com/saadmk11/github-action-upgrade"
LABEL "repository"="https://github.com/saadmk11/github-actions-version-updater"
LABEL "homepage"="https://github.com/saadmk11/github-actions-version-updater"
LABEL "maintainer"="saadmk11"

COPY requirements.txt /requirements.txt
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## GitHub Action Version Updater
## GitHub Actions Version Updater

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/saadmk11/github-action-upgrade?style=flat-square)](https://github.com/saadmk11/github-action-upgrade/releases/latest)
[![GitHub](https://img.shields.io/github/license/saadmk11/github-action-upgrade?style=flat-square)](https://github.com/saadmk11/github-action-upgrade/blob/main/LICENSE)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/saadmk11/github-actions-version-updater?style=flat-square)](https://github.com/saadmk11/github-actions-version-updater/releases/latest)
[![GitHub](https://img.shields.io/github/license/saadmk11/github-actions-version-updater?style=flat-square)](https://github.com/saadmk11/github-actions-version-updater/blob/main/LICENSE)
[![GitHub Marketplace](https://img.shields.io/badge/Get%20It-on%20Marketplace-orange?style=flat-square)](https://github.com/marketplace/actions/github-action-updater)
[![GitHub stars](https://img.shields.io/github/stars/saadmk11/github-action-upgrade?color=success&style=flat-square)](https://github.com/saadmk11/github-action-upgrade/stargazers)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/saadmk11/github-action-upgrade/Changelog%20CI?label=Changelog%20CI&style=flat-square)
[![GitHub stars](https://img.shields.io/github/stars/saadmk11/github-actions-version-updater?color=success&style=flat-square)](https://github.com/saadmk11/github-actions-version-updater/stargazers)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/saadmk11/github-actions-version-updater/Changelog%20CI?label=Changelog%20CI&style=flat-square)

**GitHub Action Version Updater** is GitHub Action that is used to **update other GitHub Actions** in a Repository
**GitHub Actions Version Updater** is GitHub Action that is used to **update other GitHub Actions** in a Repository
and create a **pull request** with the updates. It is an automated dependency updater similar to GitHub's **Dependabot**,
but for GitHub Actions.

### How Does It Work:

* GitHub Action Version Updater first goes through all the **workflows**
* GitHub Actions Version Updater first goes through all the **workflows**
in a repository and **checks for updates** for each of the action used in those workflows.

* If an update is found and if that action is **not ignored** then the workflows are updated
Expand All @@ -27,11 +27,11 @@ but for GitHub Actions.
We recommend running this action on a [`schedule`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule)
event or a [`workflow_dispatch`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event.

To integrate `GitHub Action Version Updater` on your repository, create a `YAML` file
To integrate `GitHub Actions Version Updater` on your repository, create a `YAML` file
inside `.github/workflows/` directory (`.github/workflows/updater.yaml`) add the following into the file:

```yaml
name: GitHub Action Version Updater
name: GitHub Actions Version Updater

# Controls when the action will run.
on:
Expand All @@ -51,16 +51,16 @@ jobs:
# Access token with `workflow` scope is required
token: ${{ secrets.WORKFLOW_SECRET }}

- name: Run GitHub Action Updater
uses: saadmk11/github-action-upgrade@v0.5.0
- name: Run GitHub Actions Version Updater
uses: saadmk11/github-actions-version-updater@v0.5.0
with:
# Optional, This will be used to configure git
# defaults to `github-actions[bot]` if not provided
committer_username: 'test'
committer_email: '[email protected]'
# Access token with `workflow` scope is required
token: ${{ secrets.WORKFLOW_SECRET }}
# Do not upgrade these actions (Optional)
# Do not update these actions (Optional)
# You need to add JSON array inside a string
# because GitHub Actions does not yet allow `Lists` as input
ignore: '["actions/checkout@v2", "actions/cache@v2"]'
Expand All @@ -75,9 +75,9 @@ with **repo** and **workflow** scope and pass it to the action.

To know more about how to pass a secret to GitHub actions you can [Read GitHub Docs](https://docs.github.com/en/actions/reference/encrypted-secrets)

### Demo:
### GitHub Actions Version Updater in Action:

![GitHub Action Updater](https://user-images.githubusercontent.com/24854406/113888349-15dbdc00-97e4-11eb-91a6-622828455d1f.gif)
![GitHub Actions Version Updater Demo](https://user-images.githubusercontent.com/24854406/113888349-15dbdc00-97e4-11eb-91a6-622828455d1f.gif)


### License
Expand Down
6 changes: 3 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: GitHub Action Updater
description: GitHub Action Updater upgrades GitHub Action versions and creates a pull request with the changes.
name: GitHub Actions Version Updater
description: GitHub Actions Version Updater updates GitHub Action versions in a repository and creates a pull request with the changes.
author: Maksudul Haque
branding:
icon: 'upload-cloud'
Expand All @@ -14,7 +14,7 @@ inputs:
required: false
default: 'github-actions[bot]@users.noreply.github.com'
ignore:
description: 'A JSON array which denotes the actions that should not be upgraded'
description: 'A JSON array which denotes the actions that should not be updated'
required: false
default: '[]'
token:
Expand Down
22 changes: 11 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import yaml


class GitHubActionUpgrade:
class GitHubActionsVersionUpdater:
"""Main class that checks for updates and creates pull request"""

github_api_url = 'https://api.github.com'
Expand Down Expand Up @@ -54,7 +54,7 @@ def run(self):

if not workflow_paths:
print_message(
f'No Work flow found in "{self.repository}". Skipping GitHub Actions upgrade',
f'No Workflow found in "{self.repository}". Skipping GitHub Actions Version Update',
message_type='warning'
)
return
Expand Down Expand Up @@ -124,7 +124,7 @@ def run(self):

if self.workflow_updated:
# Use timestamp to ensure uniqueness of the new branch
new_branch = f'gh-action-upgrade-{int(time.time())}'
new_branch = f'gh-actions-update-{int(time.time())}'

print_message('Create New Branch', message_type='group')

Expand All @@ -136,7 +136,7 @@ def run(self):
)
subprocess.run(['git', 'add', '.'])
subprocess.run(
['git', 'commit', '-m', 'Upgrade GitHub Action Versions']
['git', 'commit', '-m', 'Update GitHub Action Versions']
)

subprocess.run(['git', 'push', '-u', 'origin', new_branch])
Expand All @@ -158,10 +158,10 @@ def create_pull_request(self, branch_name, body):
"""Create pull request on GitHub"""
url = f'{self.github_api_url}/repos/{self.repository}/pulls'
payload = {
'title': 'Upgrade GitHub Action Versions',
'title': 'Update GitHub Action Versions',
'head': branch_name,
'base': self.base_branch,
'body': '### GitHub Actions Version Upgrades\n' + body,
'body': '### GitHub Actions Version Updates\n' + body,
}

response = requests.post(
Expand Down Expand Up @@ -297,13 +297,13 @@ def print_message(message, message_type=None):

print_message('', message_type='endgroup')

# Group: Run Upgrade GitHub Actions
print_message('Upgrade GitHub Actions', message_type='group')
# Group: Run Update GitHub Actions
print_message('Update GitHub Actions', message_type='group')

# Initialize GitHubActionUpgrade
action_upgrade = GitHubActionUpgrade(
# Initialize GitHubActionsVersionUpdater
actions_version_updater = GitHubActionsVersionUpdater(
repository, base_branch, token, ignore_actions=ignore
)
action_upgrade.run()
actions_version_updater.run()

print_message('', message_type='endgroup')

0 comments on commit 88abfc2

Please sign in to comment.