‘One of the most explicit statements regarding the divinity or deity of the Holy Spirit being called God is found twice at Acts 5. When Ananias and Sapphira lied to the church about how much money they had made on the selling of a piece of land they owned, having pledged to give a portion of that price as a love gift, Peter asks: “Why has Satan filled your heart to lie to the Holy Spiritand to keep back part of the proceeds of the land?” (Acts 5:3 NRSV, emphasis added) He then qualifies that statement: “You did not lie to us but to God!” (Acts 5:4, emphases added)
Here, Peter not only equates lying to the Holy Spirit as lying to God, but also names the Holy Spirit as being God. Lying to the Holy Spirit is an offense because lying is an attempt to deceive — as though the Spirit of God did not already know what price they had received for the land, and thus did not know that they were being deceptive. As God, the Holy Spirit knows all that can be known, and cannot be deceived.
Three hours after Peter confronts Ananias, he then approaches his wife, Sapphira, who is still unaware of what had happened to her husband. She, too, lies about the price, and Peter asks, “How is it that you have agreed together to put the Spirit of the Lord to the test?” (Acts 5:9) At this, she immediately dies. “Testing” or “tempting” God is explicitly forbidden in Scripture (cf. Deut. 6:16;Matt. 4:7; Luke 4:12). But for Peter to insist that Ananias and Sapphira were “testing” the Holy Spirit, acknowledging the act as being completely sinful, is also to insist that the Holy Spirit is God.
But, of course, the Holy Spirit is both a Person and God, since both are revealed as such in Scripture: maintaining Personhood (cf. John 14:15,16,26; 15:26,27; 16:7-14; Acts 6:9; 7:51; 13:2; Rom. 8:26,27; 15:30; 1 Cor. 2:10,11,12,13; 12:11; Eph. 4:30; Col. 1:8; 1 Thess. 5:19; 1 Tim. 4:1; Heb. 10:29; Rev. 2:7), attributes of God (cf. Gen. 1:1, 2; Job 26:13; 33:14; Ps. 104:30; 139:7,8,9,10; Luke 1:35; John 3:3,5; 14:26; 16:13; Rom. 1:4; 8:2, 11; 15:30; 1 Cor. 2:10;3:16; 12:4-6; Eph. 4:30; 2 Tim. 3:16; Heb. 9:14; 2 Pet. 1:21), and mentioned in unity with the Father and the Son (cf. Isa. 48:12, 16; Matt. 3:16, 17; 28:19; Luke 3:21, 22; John 1:33; Acts 2:33; 2 Cor. 13:14; Eph. 2:18; 1 John 5:7,8).’
source: Will Birch, “Why True Christians Believe in the Trinity” (williambirch).