Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(dependabot): auto merge pull requests #22

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
21 changes: 12 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,31 @@ assignees: ''
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
Steps to reproduce the behaviour:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
48 changes: 48 additions & 0 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: auto-merge
on:
pull_request:
permissions:
contents: write
pull-requests: write
jobs:
check-can-auto-merge:
if: github.triggering_actor == 'dependabot[bot]'
name: Check if PR can be auto-merged
runs-on: ubuntu-latest
outputs:
can-auto-merge: ${{ steps.can-auto-merge.outputs.approve }}
steps:
- uses: dependabot/[email protected]
id: dependabot-metadata
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- if: |
steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions'
id: can-auto-merge
run: echo "approve=true" >> $GITHUB_OUTPUT
auto-merge:
needs: check-can-auto-merge
if: needs.check-can-auto-merge.outputs.can-auto-merge == 'true'
name: Auto merge pull requests
runs-on: ubuntu-latest
steps:
- uses: dependabot/[email protected]
id: dependabot-metadata
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve Dependabot PR
run: gh pr review --approve "${PR_URL}"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
# Because we enforce PRs be approved by a code owner, a token from the
# operations team must be used to approve the PR. This token is from the
# StatusCake machine account which has been given membership to the
# operations team.
GITHUB_TOKEN: ${{ secrets.MACHINE_TOKEN }}
- name: Enable auto-merge for Dependabot PR
run: gh pr merge --auto --merge "${PR_URL}"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 16 additions & 4 deletions .github/workflows/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,22 @@ jobs:
node-version: 19.x
- name: Install base config
run: npm install @commitlint/config-conventional
- name: Validate all commits
- name: Validate commit messages
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to HEAD --verbose
yamllint:
name: Lint YAML documents
restructuredtext-style:
name: Check ReStructuredText style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install rstcheck
run: pip install --user rstcheck
- name: Validate ReStructuredText
run: rstcheck --report-level warning --recursive .
yaml-style:
name: Check YAML style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -54,5 +66,5 @@ jobs:
python-version: "3.10"
- name: Install yamllint
run: pip install --user yamllint
- name: Lint
- name: Validate YAML
run: yamllint .
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
strategy:
matrix:
python:
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
6 changes: 6 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"default": true,
"line-length": {
"tables": false
}
}
15 changes: 15 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# vi: ft=yaml
---
formatter:
type: basic
# There is a "bug" with the behaviour of this option that will move file head
# comments below the initial document start. For example front matter is
# rearraged and therefore misplaced in the file. This behaviour prevents
# `ymalfmt` from being run in CI or automatically in code editors.
include_document_start: true
indentless_arrays: true
pad_line_comments: 2
# There is missing functionality in `yamlfmt` to remove redundantly quoted
# strings from YAML documents, and prefer the use of double quotes (or
# whatever is configured). This means further manual effort is required to
# correct files.
2 changes: 2 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
---
extends: default
rules:
document-start:
level: error
indentation:
indent-sequences: false
spaces: 2
Expand Down
56 changes: 28 additions & 28 deletions CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,62 @@ Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age,
body size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual
identity and orientation.
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual identity
and orientation.

Our Standards
-------------

Examples of behavior that contributes to creating a positive environment
Examples of behaviour that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:
Examples of unacceptable behaviour by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

Our Responsibilities
--------------------

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
behaviour and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behaviour.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviours that they deem inappropriate, threatening,
offensive, or harmful.

Scope
-----

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an
appointed representative at an online or offline event. Representation of a
project may be further defined and clarified by project maintainers.
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

Enforcement
-----------

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at tomasbasham@gmail.com. All
Instances of abusive, harassing, or otherwise unacceptable behaviour may be
reported by contacting the project team at support@statuscake.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
Expand Down
52 changes: 0 additions & 52 deletions CONTRIBUTING.md

This file was deleted.

35 changes: 35 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
How To Contribute
=================

Contributions are welcome as we strive to make this package as useful as
possible for everyone. However time is not always on our side, and changes may
not be reviewed or merged in a timely manner.

If this package is found to be missing in functionality, please open an issue
describing the proposed change - discussing changes ahead of time reduces
friction within pull requests.

Prerequisites
-------------

You will need the following things properly installed on your computer:

- `Git <https://git-scm.com/>`_
- `Python <https://www.python.org/>`_ (3.6+)

Installation
------------

- ``git clone <repository-url>`` this repository
- ``cd statuscake-py``

Running tests
-------------

- ``pytest``

Making Changes
--------------

See the contributing guide at
`devhandbook.org <https://devhandbook.org/contributing>`_.
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ can be found `here <https://www.statuscake.com/api/v1>`_.
Prerequisites
-------------

You will need the following things properly installed on your computer.
You will need the following things properly installed on your computer:

* `Python <https://www.python.org/>`_: any one of the **three latest major**
- `Python <https://www.python.org/>`_: any one of the **three latest major**
`releases <https://www.python.org/download/releases/3.0/>`_

Installation
Expand All @@ -33,13 +33,13 @@ And then execute:

.. code:: bash

$ pip install -r requirements.txt
pip install -r requirements.txt

Or install it yourself:

.. code:: bash

$ pip install statuscake_py
pip install statuscake_py

GitHub
------
Expand All @@ -48,9 +48,9 @@ Installing the latest version from Github:

.. code:: bash

$ git clone https://github.com/StatusCakeDev/statuscake-py
$ cd statuscake-py
$ python setup.py install
git clone https://github.com/StatusCakeDev/statuscake-py
cd statuscake-py
python setup.py install

Usage
-----
Expand Down
Loading