diff --git a/.github/actions/copyright-message/test_copyright.py b/.github/actions/copyright-message/test_copyright.py new file mode 100644 index 0000000..5dfbd4c --- /dev/null +++ b/.github/actions/copyright-message/test_copyright.py @@ -0,0 +1,7 @@ +import re + +def test_copyright(): + pattern = re.compile(r"^Copyright\(c\) [a-zA-Z0-9 ]+ \d{4}$") + with open("copyright.txt", "r") as file: + content = file.read().strip() + assert pattern.match(content), "Copyright message does not match the expected format." diff --git a/.github/workflows/validate-copyright.yml b/.github/workflows/validate-copyright.yml index 0425347..3c6640e 100644 --- a/.github/workflows/validate-copyright.yml +++ b/.github/workflows/validate-copyright.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout PR head - uses: actions/checkout@v2 + uses: actions/checkout@v4.1.1 with: ref: ${{ github.event.pull_request.head.sha }}